Skip to content

Commit 0d5fcb8

Browse files
authored
Move pytest configuration settings to .pytest.toml (#14082)
1 parent 8e78242 commit 0d5fcb8

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
push:
55
paths:
66
- ".github/workflows/main.yml"
7+
- ".pytest.toml"
78
- "sphinx/**"
89
- "tests/**"
910
pull_request:
1011
paths:
1112
- ".github/workflows/main.yml"
13+
- ".pytest.toml"
1214
- "sphinx/**"
1315
- "tests/**"
1416

.pytest.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# https://docs.pytest.org/en/stable/reference/reference.html#configuration-options
2+
3+
[pytest]
4+
minversion = "9.0"
5+
6+
# https://docs.pytest.org/en/stable/reference/reference.html#command-line-flags
7+
addopts = [
8+
"-ra",
9+
"--import-mode=prepend",
10+
# "--pythonwarnings=error",
11+
]
12+
13+
empty_parameter_set_mark = "xfail"
14+
filterwarnings = [
15+
"all",
16+
"ignore::DeprecationWarning:docutils.io",
17+
"ignore:Distutils was imported before Setuptools:UserWarning:_distutils_hack",
18+
"ignore:Setuptools is replacing distutils:UserWarning:_distutils_hack",
19+
"ignore::DeprecationWarning:pyximport.pyximport",
20+
"ignore::ImportWarning:importlib._bootstrap",
21+
]
22+
log_cli_level = "INFO"
23+
markers = [
24+
"apidoc",
25+
]
26+
testpaths = ["tests"]
27+
28+
strict_config = true
29+
strict_markers = true
30+
#strict_parametrization_ids = true
31+
strict_xfail = true

pyproject.toml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ package = [
118118
"twine>=6.1",
119119
]
120120
test = [
121-
"pytest>=8.0",
121+
"pytest>=9.0",
122122
"pytest-xdist[psutil]>=3.4",
123123
"cython>=3.0", # for Cython compilation
124124
"defusedxml>=0.7.1", # for secure XML/HTML parsing
@@ -304,31 +304,6 @@ disallow_untyped_defs = false
304304
module = ["tests.test_util.typing_test_data"]
305305
ignore_errors = true
306306

307-
[tool.pytest.ini_options]
308-
minversion = "6.0"
309-
addopts = [
310-
"-ra",
311-
"--import-mode=prepend",
312-
# "--pythonwarnings=error",
313-
"--strict-config",
314-
"--strict-markers",
315-
]
316-
empty_parameter_set_mark = "xfail"
317-
filterwarnings = [
318-
"all",
319-
"ignore::DeprecationWarning:docutils.io",
320-
"ignore:Distutils was imported before Setuptools:UserWarning:_distutils_hack",
321-
"ignore:Setuptools is replacing distutils:UserWarning:_distutils_hack",
322-
"ignore::DeprecationWarning:pyximport.pyximport",
323-
"ignore::ImportWarning:importlib._bootstrap",
324-
]
325-
log_cli_level = "INFO"
326-
markers = [
327-
"apidoc",
328-
]
329-
testpaths = ["tests"]
330-
xfail_strict = true
331-
332307
[tool.coverage.run]
333308
branch = true
334309
parallel = true

0 commit comments

Comments
 (0)