2024-02-05 20:56:07 +08:00
|
|
|
[project]
|
|
|
|
name = "pytest"
|
|
|
|
description = "pytest: simple powerful testing with Python"
|
2024-02-06 03:20:31 +08:00
|
|
|
readme = "README.rst"
|
|
|
|
keywords = [
|
|
|
|
"test",
|
|
|
|
"unittest",
|
|
|
|
]
|
|
|
|
license = {text = "MIT"}
|
2024-02-05 20:56:07 +08:00
|
|
|
authors = [
|
|
|
|
{name = "Holger Krekel"},
|
|
|
|
{name = "Bruno Oliveira"},
|
|
|
|
{name = "Ronny Pfannschmidt"},
|
|
|
|
{name = "Floris Bruynooghe"},
|
|
|
|
{name = "Brianna Laugher"},
|
|
|
|
{name = "Florian Bruhin"},
|
|
|
|
{name = "Others (See AUTHORS)"},
|
|
|
|
]
|
2024-02-06 03:20:31 +08:00
|
|
|
requires-python = ">=3.8"
|
2024-02-05 20:56:07 +08:00
|
|
|
classifiers = [
|
|
|
|
"Development Status :: 6 - Mature",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Operating System :: MacOS",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
"Operating System :: POSIX",
|
2024-02-06 03:20:31 +08:00
|
|
|
"Operating System :: Unix",
|
2024-02-05 20:56:07 +08:00
|
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Programming Language :: Python :: 3.11",
|
|
|
|
"Programming Language :: Python :: 3.12",
|
|
|
|
"Topic :: Software Development :: Libraries",
|
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
"Topic :: Utilities",
|
|
|
|
]
|
2024-02-06 03:20:31 +08:00
|
|
|
dynamic = [
|
|
|
|
"version",
|
|
|
|
]
|
2024-02-05 21:20:10 +08:00
|
|
|
dependencies = [
|
2024-02-06 03:20:31 +08:00
|
|
|
'colorama; sys_platform == "win32"',
|
|
|
|
'exceptiongroup>=1.0.0rc8; python_version < "3.11"',
|
2024-02-05 21:20:10 +08:00
|
|
|
"iniconfig",
|
|
|
|
"packaging",
|
2024-02-06 03:20:31 +08:00
|
|
|
"pluggy<2.0,>=1.4",
|
|
|
|
'tomli>=1; python_version < "3.11"',
|
2024-02-05 21:20:10 +08:00
|
|
|
]
|
|
|
|
[project.optional-dependencies]
|
2024-03-08 06:12:19 +08:00
|
|
|
dev = [
|
2024-02-05 21:20:10 +08:00
|
|
|
"argcomplete",
|
2024-02-06 03:20:31 +08:00
|
|
|
"attrs>=19.2",
|
2024-02-05 21:20:10 +08:00
|
|
|
"hypothesis>=3.56",
|
|
|
|
"mock",
|
|
|
|
"pygments>=2.7.2",
|
|
|
|
"requests",
|
|
|
|
"setuptools",
|
|
|
|
"xmlschema",
|
|
|
|
]
|
2024-02-05 20:56:07 +08:00
|
|
|
[project.urls]
|
|
|
|
Changelog = "https://docs.pytest.org/en/stable/changelog.html"
|
2024-02-06 03:20:31 +08:00
|
|
|
Homepage = "https://docs.pytest.org/en/latest/"
|
2024-02-05 20:56:07 +08:00
|
|
|
Source = "https://github.com/pytest-dev/pytest"
|
|
|
|
Tracker = "https://github.com/pytest-dev/pytest/issues"
|
2024-02-06 03:20:31 +08:00
|
|
|
Twitter = "https://twitter.com/pytestdotorg"
|
|
|
|
[project.scripts]
|
|
|
|
"py.test" = "pytest:console_main"
|
|
|
|
pytest = "pytest:console_main"
|
2024-02-05 20:56:07 +08:00
|
|
|
|
2018-06-19 16:41:04 +08:00
|
|
|
[build-system]
|
2024-02-06 03:20:31 +08:00
|
|
|
build-backend = "setuptools.build_meta"
|
2018-06-19 16:41:04 +08:00
|
|
|
requires = [
|
2024-02-06 21:38:52 +08:00
|
|
|
"setuptools>=61",
|
2024-02-06 03:20:31 +08:00
|
|
|
"setuptools-scm[toml]>=6.2.3",
|
2018-06-19 16:41:04 +08:00
|
|
|
]
|
|
|
|
|
2024-02-05 22:33:27 +08:00
|
|
|
[tool.setuptools.package-data]
|
|
|
|
"_pytest" = ["py.typed"]
|
|
|
|
"pytest" = ["py.typed"]
|
|
|
|
|
2020-08-01 02:46:02 +08:00
|
|
|
[tool.setuptools_scm]
|
|
|
|
write_to = "src/_pytest/_version.py"
|
|
|
|
|
2024-02-06 03:20:31 +08:00
|
|
|
[tool.black]
|
|
|
|
target-version = ['py38']
|
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
src = ["src"]
|
|
|
|
line-length = 88
|
2024-02-09 16:48:05 +08:00
|
|
|
|
|
|
|
[tool.ruff.format]
|
|
|
|
docstring-code-format = true
|
|
|
|
|
|
|
|
[tool.ruff.lint]
|
2024-02-06 03:20:31 +08:00
|
|
|
select = [
|
|
|
|
"B", # bugbear
|
|
|
|
"D", # pydocstyle
|
|
|
|
"E", # pycodestyle
|
|
|
|
"F", # pyflakes
|
|
|
|
"I", # isort
|
|
|
|
"PYI", # flake8-pyi
|
|
|
|
"UP", # pyupgrade
|
|
|
|
"RUF", # ruff
|
|
|
|
"W", # pycodestyle
|
2024-02-09 17:08:33 +08:00
|
|
|
"PIE", # flake8-pie
|
2024-02-09 17:14:36 +08:00
|
|
|
"PGH004", # pygrep-hooks - Use specific rule codes when using noqa
|
2024-02-11 06:41:33 +08:00
|
|
|
"PLE", # pylint error
|
|
|
|
"PLW", # pylint warning
|
2024-02-10 22:46:45 +08:00
|
|
|
"PLR1714", # Consider merging multiple comparisons
|
2024-02-06 03:20:31 +08:00
|
|
|
]
|
|
|
|
ignore = [
|
|
|
|
# bugbear ignore
|
|
|
|
"B004", # Using `hasattr(x, "__call__")` to test if x is callable is unreliable.
|
|
|
|
"B007", # Loop control variable `i` not used within loop body
|
|
|
|
"B009", # Do not call `getattr` with a constant attribute value
|
|
|
|
"B010", # [*] Do not call `setattr` with a constant attribute value.
|
|
|
|
"B011", # Do not `assert False` (`python -O` removes these calls)
|
|
|
|
"B028", # No explicit `stacklevel` keyword argument found
|
|
|
|
# pycodestyle ignore
|
|
|
|
# pytest can do weird low-level things, and we usually know
|
|
|
|
# what we're doing when we use type(..) is ...
|
|
|
|
"E721", # Do not compare types, use `isinstance()`
|
|
|
|
# pydocstyle ignore
|
|
|
|
"D100", # Missing docstring in public module
|
|
|
|
"D101", # Missing docstring in public class
|
|
|
|
"D102", # Missing docstring in public method
|
|
|
|
"D103", # Missing docstring in public function
|
|
|
|
"D104", # Missing docstring in public package
|
|
|
|
"D105", # Missing docstring in magic method
|
|
|
|
"D106", # Missing docstring in public nested class
|
|
|
|
"D107", # Missing docstring in `__init__`
|
|
|
|
"D209", # [*] Multi-line docstring closing quotes should be on a separate line
|
|
|
|
"D205", # 1 blank line required between summary line and description
|
|
|
|
"D400", # First line should end with a period
|
|
|
|
"D401", # First line of docstring should be in imperative mood
|
|
|
|
"D402", # First line should not be the function's signature
|
|
|
|
"D404", # First word of the docstring should not be "This"
|
|
|
|
"D415", # First line should end with a period, question mark, or exclamation point
|
|
|
|
# ruff ignore
|
|
|
|
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
|
2024-02-11 06:41:33 +08:00
|
|
|
# pylint ignore
|
|
|
|
"PLW0603", # Using the global statement
|
|
|
|
"PLW0120", # remove the else and dedent its contents
|
|
|
|
"PLW2901", # for loop variable overwritten by assignment target
|
|
|
|
"PLR5501", # Use `elif` instead of `else` then `if`
|
2024-02-06 03:20:31 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
[tool.ruff.lint.pycodestyle]
|
|
|
|
# In order to be able to format for 88 char in ruff format
|
|
|
|
max-line-length = 120
|
|
|
|
|
|
|
|
[tool.ruff.lint.pydocstyle]
|
|
|
|
convention = "pep257"
|
|
|
|
|
|
|
|
[tool.ruff.lint.isort]
|
|
|
|
force-single-line = true
|
|
|
|
combine-as-imports = true
|
|
|
|
force-sort-within-sections = true
|
|
|
|
order-by-type = false
|
|
|
|
known-local-folder = ["pytest", "_pytest"]
|
|
|
|
lines-after-imports = 2
|
|
|
|
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
"src/_pytest/_py/**/*.py" = ["B", "PYI"]
|
|
|
|
"src/_pytest/_version.py" = ["I001"]
|
|
|
|
"testing/python/approx.py" = ["B015"]
|
|
|
|
|
2024-03-31 03:55:27 +08:00
|
|
|
[tool.pylint.main]
|
|
|
|
# Maximum number of characters on a single line.
|
|
|
|
max-line-length = 120
|
|
|
|
disable= [
|
|
|
|
"abstract-method",
|
|
|
|
"arguments-differ",
|
|
|
|
"arguments-renamed",
|
|
|
|
"assigning-non-slot",
|
|
|
|
"attribute-defined-outside-init",
|
|
|
|
"bad-classmethod-argument",
|
|
|
|
"bad-mcs-method-argument",
|
|
|
|
"broad-exception-caught",
|
|
|
|
"broad-exception-raised",
|
|
|
|
"cell-var-from-loop",
|
|
|
|
"comparison-of-constants",
|
|
|
|
"comparison-with-callable",
|
|
|
|
"comparison-with-itself",
|
|
|
|
"condition-evals-to-constant",
|
|
|
|
"consider-using-dict-items",
|
|
|
|
"consider-using-enumerate",
|
|
|
|
"consider-using-from-import",
|
|
|
|
"consider-using-f-string",
|
|
|
|
"consider-using-in",
|
|
|
|
"consider-using-sys-exit",
|
|
|
|
"consider-using-ternary",
|
|
|
|
"consider-using-with",
|
|
|
|
"cyclic-import",
|
|
|
|
"disallowed-name",
|
|
|
|
"duplicate-code",
|
|
|
|
"eval-used",
|
|
|
|
"exec-used",
|
|
|
|
"expression-not-assigned",
|
|
|
|
"fixme",
|
|
|
|
"global-statement",
|
|
|
|
"implicit-str-concat",
|
|
|
|
"import-error",
|
|
|
|
"import-outside-toplevel",
|
|
|
|
"inconsistent-return-statements",
|
|
|
|
"invalid-bool-returned",
|
|
|
|
"invalid-name",
|
|
|
|
"invalid-repr-returned",
|
|
|
|
"invalid-str-returned",
|
|
|
|
"keyword-arg-before-vararg",
|
|
|
|
"line-too-long",
|
|
|
|
"method-hidden",
|
|
|
|
"misplaced-bare-raise",
|
|
|
|
"missing-docstring",
|
|
|
|
"missing-timeout",
|
|
|
|
"multiple-statements",
|
|
|
|
"no-else-break",
|
|
|
|
"no-else-continue",
|
|
|
|
"no-else-raise",
|
|
|
|
"no-else-return",
|
|
|
|
"no-member",
|
|
|
|
"no-name-in-module",
|
|
|
|
"no-self-argument",
|
|
|
|
"not-an-iterable",
|
|
|
|
"not-callable",
|
|
|
|
"pointless-exception-statement",
|
|
|
|
"pointless-statement",
|
|
|
|
"pointless-string-statement",
|
|
|
|
"protected-access",
|
|
|
|
"raise-missing-from",
|
|
|
|
"redefined-argument-from-local",
|
|
|
|
"redefined-builtin",
|
|
|
|
"redefined-outer-name",
|
|
|
|
"reimported",
|
|
|
|
"simplifiable-condition",
|
|
|
|
"simplifiable-if-expression",
|
|
|
|
"singleton-comparison",
|
|
|
|
"superfluous-parens",
|
|
|
|
"super-init-not-called",
|
|
|
|
"too-few-public-methods",
|
|
|
|
"too-many-ancestors",
|
|
|
|
"too-many-arguments",
|
|
|
|
"too-many-branches",
|
|
|
|
"too-many-function-args",
|
|
|
|
"too-many-instance-attributes",
|
|
|
|
"too-many-lines",
|
|
|
|
"too-many-locals",
|
|
|
|
"too-many-nested-blocks",
|
|
|
|
"too-many-public-methods",
|
|
|
|
"too-many-return-statements",
|
|
|
|
"too-many-statements",
|
|
|
|
"try-except-raise",
|
|
|
|
"typevar-name-incorrect-variance",
|
|
|
|
"unbalanced-tuple-unpacking",
|
|
|
|
"undefined-loop-variable",
|
|
|
|
"undefined-variable",
|
|
|
|
"unexpected-keyword-arg",
|
|
|
|
"unidiomatic-typecheck",
|
|
|
|
"unnecessary-comprehension",
|
|
|
|
"unnecessary-dunder-call",
|
|
|
|
"unnecessary-lambda",
|
|
|
|
"unnecessary-lambda-assignment",
|
|
|
|
"unpacking-non-sequence",
|
|
|
|
"unspecified-encoding",
|
|
|
|
"unsubscriptable-object",
|
|
|
|
"unused-argument",
|
|
|
|
"unused-import",
|
|
|
|
"unused-variable",
|
|
|
|
"used-before-assignment",
|
|
|
|
"use-dict-literal",
|
|
|
|
"use-implicit-booleaness-not-comparison",
|
|
|
|
"use-implicit-booleaness-not-len",
|
|
|
|
"useless-else-on-loop",
|
|
|
|
"useless-import-alias",
|
|
|
|
"useless-return",
|
|
|
|
"use-maxsplit-arg",
|
|
|
|
"using-constant-test",
|
|
|
|
"wrong-import-order",
|
|
|
|
]
|
|
|
|
|
2024-02-06 03:20:31 +08:00
|
|
|
[tool.check-wheel-contents]
|
|
|
|
# check-wheel-contents is executed by the build-and-inspect-python-package action.
|
|
|
|
# W009: Wheel contains multiple toplevel library entries
|
|
|
|
ignore = "W009"
|
|
|
|
|
|
|
|
[tool.pyproject-fmt]
|
|
|
|
indent = 4
|
|
|
|
|
2020-06-08 21:03:10 +08:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
minversion = "2.0"
|
|
|
|
addopts = "-rfEX -p pytester --strict-markers"
|
2020-09-20 02:56:52 +08:00
|
|
|
python_files = ["test_*.py", "*_test.py", "testing/python/*.py"]
|
2020-06-08 21:03:10 +08:00
|
|
|
python_classes = ["Test", "Acceptance"]
|
|
|
|
python_functions = ["test"]
|
|
|
|
# NOTE: "doc" is not included here, but gets tested explicitly via "doctesting".
|
|
|
|
testpaths = ["testing"]
|
2023-08-20 05:16:31 +08:00
|
|
|
norecursedirs = [
|
|
|
|
"testing/example_scripts",
|
|
|
|
".*",
|
|
|
|
"build",
|
|
|
|
"dist",
|
|
|
|
]
|
2020-06-08 21:03:10 +08:00
|
|
|
xfail_strict = true
|
|
|
|
filterwarnings = [
|
|
|
|
"error",
|
|
|
|
"default:Using or importing the ABCs:DeprecationWarning:unittest2.*",
|
2020-11-05 22:08:54 +08:00
|
|
|
# produced by older pyparsing<=2.2.0.
|
|
|
|
"default:Using or importing the ABCs:DeprecationWarning:pyparsing.*",
|
2020-06-08 21:03:10 +08:00
|
|
|
"default:the imp module is deprecated in favour of importlib:DeprecationWarning:nose.*",
|
2021-03-27 21:37:34 +08:00
|
|
|
# distutils is deprecated in 3.10, scheduled for removal in 3.12
|
|
|
|
"ignore:The distutils package is deprecated:DeprecationWarning",
|
2020-06-08 21:03:10 +08:00
|
|
|
# produced by pytest-xdist
|
|
|
|
"ignore:.*type argument to addoption.*:DeprecationWarning",
|
2020-10-19 15:02:36 +08:00
|
|
|
# produced on execnet (pytest-xdist)
|
2020-06-08 21:03:10 +08:00
|
|
|
"ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning",
|
|
|
|
# pytest's own futurewarnings
|
|
|
|
"ignore::pytest.PytestExperimentalApiWarning",
|
|
|
|
# Do not cause SyntaxError for invalid escape sequences in py37.
|
|
|
|
# Those are caught/handled by pyupgrade, and not easy to filter with the
|
|
|
|
# module being the filename (with .py removed).
|
|
|
|
"default:invalid escape sequence:DeprecationWarning",
|
2021-10-03 22:01:40 +08:00
|
|
|
# ignore not yet fixed warnings for hook markers
|
|
|
|
"default:.*not marked using pytest.hook.*",
|
|
|
|
"ignore:.*not marked using pytest.hook.*::xdist.*",
|
2020-06-08 21:03:10 +08:00
|
|
|
# ignore use of unregistered marks, because we use many to test the implementation
|
|
|
|
"ignore::_pytest.warning_types.PytestUnknownMarkWarning",
|
2021-04-14 17:31:28 +08:00
|
|
|
# https://github.com/benjaminp/six/issues/341
|
|
|
|
"ignore:_SixMetaPathImporter\\.exec_module\\(\\) not found; falling back to load_module\\(\\):ImportWarning",
|
|
|
|
# https://github.com/benjaminp/six/pull/352
|
|
|
|
"ignore:_SixMetaPathImporter\\.find_spec\\(\\) not found; falling back to find_module\\(\\):ImportWarning",
|
|
|
|
# https://github.com/pypa/setuptools/pull/2517
|
|
|
|
"ignore:VendorImporter\\.find_spec\\(\\) not found; falling back to find_module\\(\\):ImportWarning",
|
|
|
|
# https://github.com/pytest-dev/execnet/pull/127
|
|
|
|
"ignore:isSet\\(\\) is deprecated, use is_set\\(\\) instead:DeprecationWarning",
|
2020-06-08 21:03:10 +08:00
|
|
|
]
|
|
|
|
pytester_example_dir = "testing/example_scripts"
|
|
|
|
markers = [
|
|
|
|
# dummy markers for testing
|
|
|
|
"foo",
|
|
|
|
"bar",
|
|
|
|
"baz",
|
|
|
|
# conftest.py reorders tests moving slow ones to the end of the list
|
|
|
|
"slow",
|
|
|
|
# experimental mark for all tests using pexpect
|
|
|
|
"uses_pexpect",
|
|
|
|
]
|
|
|
|
|
2017-05-30 21:54:15 +08:00
|
|
|
[tool.towncrier]
|
|
|
|
package = "pytest"
|
2018-06-05 09:01:23 +08:00
|
|
|
package_dir = "src"
|
2019-11-25 11:06:30 +08:00
|
|
|
filename = "doc/en/changelog.rst"
|
2017-05-30 21:54:15 +08:00
|
|
|
directory = "changelog/"
|
2018-07-27 20:21:18 +08:00
|
|
|
title_format = "pytest {version} ({project_date})"
|
2017-05-30 21:54:15 +08:00
|
|
|
template = "changelog/_template.rst"
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
2019-12-06 19:47:39 +08:00
|
|
|
directory = "breaking"
|
|
|
|
name = "Breaking Changes"
|
2018-09-14 01:02:01 +08:00
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "deprecation"
|
|
|
|
name = "Deprecations"
|
2017-05-30 21:54:15 +08:00
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "feature"
|
|
|
|
name = "Features"
|
|
|
|
showcontent = true
|
|
|
|
|
2019-08-10 20:26:37 +08:00
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "improvement"
|
|
|
|
name = "Improvements"
|
|
|
|
showcontent = true
|
|
|
|
|
2017-05-30 21:54:15 +08:00
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "bugfix"
|
|
|
|
name = "Bug Fixes"
|
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "vendor"
|
|
|
|
name = "Vendored Libraries"
|
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "doc"
|
|
|
|
name = "Improved Documentation"
|
|
|
|
showcontent = true
|
|
|
|
|
|
|
|
[[tool.towncrier.type]]
|
|
|
|
directory = "trivial"
|
2017-06-23 23:30:29 +08:00
|
|
|
name = "Trivial/Internal Changes"
|
|
|
|
showcontent = true
|
2020-03-07 09:18:41 +08:00
|
|
|
|
2024-02-05 17:53:21 +08:00
|
|
|
[tool.mypy]
|
2024-03-13 21:30:18 +08:00
|
|
|
files = ["src", "testing", "scripts"]
|
2024-02-05 17:53:21 +08:00
|
|
|
mypy_path = ["src"]
|
|
|
|
check_untyped_defs = true
|
|
|
|
disallow_any_generics = true
|
|
|
|
disallow_untyped_defs = true
|
|
|
|
ignore_missing_imports = true
|
|
|
|
show_error_codes = true
|
|
|
|
strict_equality = true
|
|
|
|
warn_redundant_casts = true
|
|
|
|
warn_return_any = true
|
|
|
|
warn_unreachable = true
|
|
|
|
warn_unused_configs = true
|
|
|
|
no_implicit_reexport = true
|
2024-03-13 21:30:18 +08:00
|
|
|
warn_unused_ignores = true
|