Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .pytest.toml
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
16 changes: 0 additions & 16 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ docutils >= 0.19.0
sphinx-notfound-page >= 1.0.2

# For tests
pytest
pytest>=9
pytest-cov

# For python-releases.toml
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

@hugovk hugovk Nov 27, 2025

Choose a reason for hiding this comment

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

And also skip/omit/exclude release_management/__main__.py as suggested in #4704?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't that already covered by the blanket exclusion?

A

Copy link
Member Author

Choose a reason for hiding this comment

The 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!