-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Does this plugin works with module top-level pragmas. #2
Comments
I'm just running into this same question. In our case we have I need to be able to exclude all but the correct one from coverage reporting, depending on the platform being used. I just tried this pyproject.toml: [tool.coverage.run]
omit = [ "tests/*", "venv/*", "dist.win32/*" ]
plugins = [ "coverage_conditional_plugin" ]
[tool.coverage.coverage_conditional_plugin.rules]
sys-platform-win32 = "sys_platform == 'win32'"
sys-platform-not-win32 = "sys_platform != 'win32'"
sys-platform-darwin = "sys_platform == 'darwin'"
sys-platform-not-darwin = "sys_platform != 'darwin'"
sys-platform-linux = "sys_platform == 'linux'"
sys-platform-not-linux = "sys_platform != 'linux'" And this in # pragma: sys-platform-not-darwin
... But all that does is cause line 2 to be ignore, and everything from line 3 onwards to be reported as not covered. |
Sorry, but this does not work. [tool.coverage.coverage_conditional_plugin.modules]
"module.name" = "sys_platform != 'linux'" PRs are welcome! |
If I have a module in my library which should be imported only for Django 0.9.6, can I put
# pragma: petrified_mammoth_shit
right after coding comment?Thanks for the awesome project 🎉
The text was updated successfully, but these errors were encountered: