Skip to content
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

--omit doesn't seem to work in "coverage report" #143

Closed
nedbat opened this issue Aug 10, 2011 · 2 comments
Closed

--omit doesn't seem to work in "coverage report" #143

nedbat opened this issue Aug 10, 2011 · 2 comments
Labels
bug Something isn't working report

Comments

@nedbat
Copy link
Owner

nedbat commented Aug 10, 2011

Originally reported by Дмитрий (Bitbucket: divius, GitHub: Unknown)


I have report like

...
/opt/ibd3/lib/python2.7/site-packages/ibd3/templating                               106     12     50     11    85%  
/opt/ibd3/lib/python2.7/site-packages/ibd3/tests/__init__                             0      0      0      0   100%   
/opt/ibd3/lib/python2.7/site-packages/ibd3/tests/test_access                         96      0      0      0   100%   
/opt/ibd3/lib/python2.7/site-packages/ibd3/tests/test_admin_demo                     23      0      2      1    96%   
/opt/ibd3/lib/python2.7/site-packages/ibd3/tests/test_application                    37      0      4      0   100%   
/opt/ibd3/lib/python2.7/site-packages/ibd3/tests/test_apps_conf                      70      0      0      0   100%   
...

where /opt/ibd3/lib/python2.7/site-packages/ibd3/tests/* are tests themselves. I want to get rid of them, so I tried to use --omit flag the following ways:

$ /opt/ibd3//bin/coverage report -m  --omit="*/ibd3/tests/*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="\*/ibd3/tests/\*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="test_*.py"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="test_\*.py"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="test_\*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="test_*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="*test_*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="\*test_\*"  > _trial_temp/coverage.txt
$ /opt/ibd3//bin/coverage report -m  --omit="\\*test_\\*"  > _trial_temp/coverage.txt

Nothing of this helps: tests are still there. Am I doing something wrong or is it a bug in coverage?


@nedbat
Copy link
Owner Author

nedbat commented Aug 10, 2011

Original comment by Дмитрий (Bitbucket: divius, GitHub: Unknown)


Btw, --omit="/ibd3/tests/" works when used with "coverage run ".

@nedbat
Copy link
Owner Author

nedbat commented Nov 12, 2012

Fixed in <<changeset 29662e9378ca (bb)>>, just like #163.

@nedbat nedbat closed this as completed Nov 12, 2012
@nedbat nedbat added major bug Something isn't working report labels Jun 23, 2018
agronholm pushed a commit to agronholm/coveragepy that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working report
Projects
None yet
Development

No branches or pull requests

1 participant