diff options
author | Brad Warren <bmw@users.noreply.github.com> | 2019-01-31 23:57:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-31 23:57:49 +0300 |
commit | 0484b1554d31db9fd284dcf0234d761bb5ebe4fd (patch) | |
tree | e99f7d4c7444dc7c5857679b27a73eaae91b6bb6 /tox.cover.py | |
parent | 4237d4a3adbc1dd9e7dfca8f669ad73dee62e273 (diff) |
Set --pyargs directly in the files where it is needed. (#6727)
It was pointed out to me that you can no longer run tox.cover.py directly to run coverage tests on a subset of the packages in this repo.
This happened after we did both of:
1. Factored out --pyargs from the different test files and put it in pytest.ini.
2. Moved the options we added to pytest.ini to tox.ini meaning that --pyargs is not set unless you run the file through tox.
I think the fact that we factored out --pyargs from the files that needed it was a mistake. --pytest is needed by tox.cover.py and install_and_test.py in order to work correctly.
I think CLI options like this which are needed for the file to function should be left in the file directly. Doing anything else in my opinion unnecessarily couples these scripts to other files making them more brittle and harder to maintain.
With that said, I also think CLI options which are not needed (such as --numprocesses) can be left to be optionally added through PYTEST_ADDOPTS.
* Add --pyargs to tox.cover.py.
* Add --pyargs to install_and_test.py.
* Remove --pyargs from tox.ini.
Diffstat (limited to 'tox.cover.py')
-rwxr-xr-x | tox.cover.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tox.cover.py b/tox.cover.py index c8a45d82d..008424641 100755 --- a/tox.cover.py +++ b/tox.cover.py @@ -48,8 +48,8 @@ def cover(package): .format(pkg_dir))) return - subprocess.check_call([ - sys.executable, '-m', 'pytest', '--cov', pkg_dir, '--cov-append', '--cov-report=', package]) + subprocess.check_call([sys.executable, '-m', 'pytest', '--pyargs', + '--cov', pkg_dir, '--cov-append', '--cov-report=', package]) subprocess.check_call([ sys.executable, '-m', 'coverage', 'report', '--fail-under', str(threshold), '--include', '{0}/*'.format(pkg_dir), '--show-missing']) |