1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 15:27:14 +03:00

pytest/coverage: Improve the .toml comment about pragma 'inversion'

This commit is contained in:
Athanasius 2022-10-02 12:38:24 +01:00
parent 7aa832e3d1
commit 80a8a32666
No known key found for this signature in database
GPG Key ID: 8C392035DD80FD62
2 changed files with 10 additions and 4 deletions

View File

@ -263,8 +263,6 @@ e.g.
```toml
[tool.coverage.coverage_conditional_plugin.rules]
# Yes, the sense of all of these is inverted, because else it ends up
# inverted at *every* use.
sys-platform-win32 = "sys_platform != 'win32'"
...
```
@ -280,6 +278,12 @@ else: # pragma: sys-platform-not-win32
Note the inverted sense of the pragma definitions, as the comments cause
`coverage` to *not* consider that code block on this platform.
As of 2022-10-02 and `coverage-conditional-plugin==0.7.0` there is no way to
signal that an entire file should be excluded from coverage reporting on the
current platform. See
[this GitHub issue comment](https://github.com/wemake-services/coverage-conditional-plugin/issues/2#issuecomment-1263918296)
.
---
## Imports used only in core plugins

View File

@ -15,8 +15,10 @@ omit = [ "tests/*", "venv/*", "dist.win32/*" ]
plugins = [ "coverage_conditional_plugin" ]
[tool.coverage.coverage_conditional_plugin.rules]
# Yes, the sense of all of these is inverted, because else it ends up
# inverted at *every* use.
# NB: The name versus content of all of these are inverted because of the way
# they're used. When a pragma cites one it causes that code block to
# **NOT** be considered for code coverage.
# See Contributin.md#test-coverage for more details.
sys-platform-win32 = "sys_platform != 'win32'"
sys-platform-not-win32 = "sys_platform == 'win32'"
sys-platform-darwin = "sys_platform != 'darwin'"