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

Fix coverage-conditional-plugin syntax #2004

Merged

Conversation

br3ndonland
Copy link
Contributor

Summary

The coverage-conditional-plugin allows code to be conditionally omitted from test coverage reports. The syntax can be confusing (wemake-services/coverage-conditional-plugin#188).

The py-gte-39 rule is backwards.

uvicorn/pyproject.toml

Lines 124 to 125 in 3737d66

py-gte-39 = "sys_version_info < (3, 9)"
py-lt-39 = "sys_version_info < (3, 9)"

The omit added in #2001 is backwards and isn't supported on version 0.8.0.

uvicorn/pyproject.toml

Lines 114 to 115 in 3737d66

[tool.coverage.coverage_conditional_plugin.omit]
"uvicorn/loops/uvloop.py" = "sys_platform == 'win32'"

coverage-conditional-plugin==0.8.0

Coverage reports demonstrate this.

encode-uvicorn-3217-incorrect-conditional-pragma

Changes

  • Fix py-gte-39 rule
  • Fix omit syntax
  • Update to coverage-conditional-plugin==0.9.0 to support omit syntax

Related

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@br3ndonland br3ndonland requested a review from Kludex June 10, 2023 22:07
Copy link
Sponsor Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@Kludex Kludex merged commit d62a537 into encode:master Jun 11, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants