diff --git a/.gitignore b/.gitignore index febd0f7f1..b435627ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ *.pyc build/ dist/ +htmlcov/ MANIFEST .*.swp *.egg-info .idea/ docs/_build +.coverage .testrepository/ .tox venv/ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 44644a639..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./gitlab/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/MANIFEST.in b/MANIFEST.in index 2d1b15b11..df53d6691 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 * diff --git a/test-requirements.txt b/test-requirements.txt index 65d09d7d3..c78843606 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 0aa43f09e..35ad0a21c 100644 --- a/tox.ini +++ b/tox.ini @@ -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 = @@ -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