-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Tests: Improve tests and coverage configuration #4715
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # https://docs.pytest.org/en/stable/reference/customize.html | ||
|
|
||
| [pytest] | ||
| minversion = "9.0" | ||
|
|
||
| # https://docs.pytest.org/en/stable/reference/reference.html#command-line-flags | ||
| addopts = [ | ||
| # Show extra summary information for all non-passing tests | ||
| "-r a", | ||
| # https://docs.pytest.org/en/stable/explanation/pythonpath.html#import-modes | ||
| "--import-mode=importlib", | ||
| # https://pytest-cov.readthedocs.io/en/latest/config.html#reference | ||
| "--cov=check_peps", | ||
| "--cov=pep_sphinx_extensions", | ||
| "--cov-report=html", | ||
| "--cov-report=xml", | ||
| ] | ||
|
|
||
| # Fail if pytest.mark.parametrize() has no parameters | ||
| empty_parameter_set_mark = "fail_at_collect" | ||
|
|
||
| filterwarnings = ["error"] | ||
|
|
||
| testpaths = [ | ||
| "pep_sphinx_extensions", | ||
| ] | ||
|
|
||
| # https://docs.pytest.org/en/stable/reference/reference.html#confval-strict | ||
| strict_config = true | ||
| strict_markers = true | ||
| strict_parametrization_ids = true | ||
| strict_xfail = true | ||
|
|
||
| # Various tests use Unicode in pytest.mark.parametrize(). | ||
| disable_test_id_escaping_and_forfeit_all_rights_to_community_support = true |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,12 @@ pass_env = | |
| FORCE_COLOR | ||
| commands = | ||
| python -bb -X dev -W error -m pytest {posargs} | ||
|
|
||
| [coverage:run] | ||
| omit = | ||
| */__main__.py # Ignore all __main__.py files | ||
| peps/* # Ignore all files in the PEPs folder | ||
|
|
||
| [coverage:report] | ||
| exclude_also = | ||
| if __name__ == .__main__.: | ||
|
Comment on lines
+21
to
+23
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And also skip/omit/exclude
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't that already covered by the blanket exclusion? A
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I merged this to pull it into #4705 to test, it appears that the blanket exclusion does work, but only if there are no comments on the same line. I can't find anything in coverage's docs or GH issues about comments either way. Sorry for my error here! |
||
Uh oh!
There was an error while loading. Please reload this page.