From afd81fc790266ada9dd39f3490646f5fd68cdf54 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Thu, 6 Apr 2017 14:52:21 +0100 Subject: [PATCH] Need to install pytest-cov (in addition to coverage). Pytest has problems reading options from setup.cfg, but seems to like pytest.ini. --- README.md | 4 ++-- pytest.ini | 3 +++ setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 pytest.ini diff --git a/README.md b/README.md index 6fbc679e4..bd541aa02 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ The HTML documentation will be generated and saved in the `doc/html/` directory. Tests ----- -To run the tests, install `pytest` and `coverage`, and then run: +To run the tests, install `pytest` and `pytest-cov`, and then run: - python setup.py test --addopts="-v --niters=50 --cov=fsl --cov-report=html" + python setup.py test A code coverage report will be generated in `htmlcov/`. diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..599c0c249 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = tests +addopts = -v --niters=50 --cov=fsl --cov-report=html diff --git a/setup.cfg b/setup.cfg index 9af7e6f11..b7e478982 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [aliases] -test=pytest \ No newline at end of file +test=pytest diff --git a/setup.py b/setup.py index 0d5ba189d..246320837 100644 --- a/setup.py +++ b/setup.py @@ -98,7 +98,7 @@ setup( install_requires=install_requires, setup_requires=['pytest-runner'], - tests_require=['pytest', 'pytest-runner'], + tests_require=['pytest', 'pytest-cov', 'pytest-runner'], test_suite='tests', cmdclass={'doc' : doc}, -- GitLab