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

Consolidate config in pyproject.toml #15548

Merged
merged 1 commit into from
Jun 29, 2023
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
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,47 @@ extra-standard-library = ["typing_extensions"]

[tool.check-manifest]
ignore = ["**/.readthedocs.yaml"]

[tool.pytest.ini_options]
minversion = "6.0.0"
testpaths = ["mypy/test", "mypyc/test"]
python_files = 'test*.py'

# Where do the test cases come from? We provide our own collection
# logic by implementing `pytest_pycollect_makeitem` in mypy.test.data;
# the test files import that module, and pytest sees the magic name
# and invokes it at the relevant moment. See
# https://doc.pytest.org/en/latest/how-to/writing_plugins.html#collection-hooks

# Both our plugin and unittest provide their own collection logic,
# So we can disable the default python collector by giving it empty
# patterns to search for.
# Note that unittest requires that no "Test*" classes exist.
python_classes = []
python_functions = []

# always run in parallel (requires pytest-xdist, see test-requirements.txt)
# and enable strict mode: require all markers
# to be defined and raise on invalid config values
addopts = "-nauto --strict-markers --strict-config"

# treat xpasses as test failures so they get converted to regular tests as soon as possible
xfail_strict = true

[tool.coverage.run]
branch = true
source = "mypy"
parallel = true

[tool.coverage.report]
show_missing = true
skip_covered = true
omit = 'mypy/test/*'
exclude_lines = [
'\#\s*pragma: no cover',
'^\s*raise AssertionError\b',
'^\s*raise NotImplementedError\b',
'^\s*return NotImplemented\b',
'^\s*raise$',
'''^if __name__ == ['"]__main__['"]:$''',
]
27 changes: 0 additions & 27 deletions pytest.ini

This file was deleted.

16 changes: 0 additions & 16 deletions setup.cfg

This file was deleted.