Skip to content

chore: use pytest for unit tests and coverage #1028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
*.pyc
build/
dist/
htmlcov/
MANIFEST
.*.swp
*.egg-info
.idea/
docs/_build
.coverage
.testrepository/
.tox
venv/
4 changes: 0 additions & 4 deletions .testr.conf

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include COPYING AUTHORS ChangeLog.rst RELEASE_NOTES.rst requirements.txt test-requirements.txt rtd-requirements.txt
include tox.ini .testr.conf .travis.yml
include tox.ini .travis.yml
recursive-include tools *
recursive-include docs *j2 *.py *.rst api/*.rst Makefile make.bat
recursive-include gitlab/tests/data *
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
coverage
discover
testrepository
hacking>=0.9.2,<0.10
httmock
jinja2
mock
pytest
pytest-cov
sphinx>=1.3
sphinx_rtd_theme
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python setup.py testr --testr-args='{posargs}'
pytest {posargs} gitlab/tests

[testenv:pep8]
commands =
Expand All @@ -39,9 +39,11 @@ commands = python setup.py build_sphinx

[testenv:cover]
commands =
python setup.py testr --slowest --coverage --testr-args="{posargs}"
coverage report --omit=*tests*
coverage html --omit=*tests*
pytest --cov gitlab --cov-report term --cov-report html \
{posargs} gitlab/tests

[coverage:run]
omit = *tests*

[testenv:cli_func_v4]
commands = {toxinidir}/tools/functional_tests.sh -a 4 -p 2
Expand Down