Skip to content

Commit d0b978b

Browse files
committed
chore: use pytest for unit tests and coverage
1 parent e8f0921 commit d0b978b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
*.pyc
22
build/
33
dist/
4+
htmlcov/
45
MANIFEST
56
.*.swp
67
*.egg-info
78
.idea/
89
docs/_build
10+
.coverage
911
.testrepository/
1012
.tox
1113
venv/

.testr.conf

-4
This file was deleted.

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include COPYING AUTHORS ChangeLog.rst RELEASE_NOTES.rst requirements.txt test-requirements.txt rtd-requirements.txt
2-
include tox.ini .testr.conf .travis.yml
2+
include tox.ini .travis.yml
33
recursive-include tools *
44
recursive-include docs *j2 *.py *.rst api/*.rst Makefile make.bat
55
recursive-include gitlab/tests/data *

test-requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
coverage
2-
discover
3-
testrepository
42
hacking>=0.9.2,<0.10
53
httmock
64
jinja2
75
mock
6+
pytest
7+
pytest-cov
88
sphinx>=1.3
99
sphinx_rtd_theme

tox.ini

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install_command = pip install {opts} {packages}
1212
deps = -r{toxinidir}/requirements.txt
1313
-r{toxinidir}/test-requirements.txt
1414
commands =
15-
python setup.py testr --testr-args='{posargs}'
15+
pytest {posargs} gitlab/tests
1616

1717
[testenv:pep8]
1818
commands =
@@ -39,9 +39,11 @@ commands = python setup.py build_sphinx
3939

4040
[testenv:cover]
4141
commands =
42-
python setup.py testr --slowest --coverage --testr-args="{posargs}"
43-
coverage report --omit=*tests*
44-
coverage html --omit=*tests*
42+
pytest --cov gitlab --cov-report term --cov-report html \
43+
{posargs} gitlab/tests
44+
45+
[coverage:run]
46+
omit = *tests*
4547

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

0 commit comments

Comments
 (0)