31
31
from _pytest .pytester import Pytester
32
32
33
33
34
- setup_cfg_nowarn = pytest .mark .filterwarnings (
35
- "ignore:.*setup.cfg.*:pytest.PytestDeprecationWarning"
36
- )
37
-
38
-
39
34
class TestParseIni :
40
35
@pytest .mark .parametrize (
41
- "section, filename" ,
42
- [
43
- ("pytest" , "pytest.ini" ),
44
- pytest .param ("tool:pytest" , "setup.cfg" , marks = setup_cfg_nowarn ),
45
- ],
36
+ "section, filename" , [("pytest" , "pytest.ini" ), ("tool:pytest" , "setup.cfg" )]
46
37
)
47
38
def test_getcfg_and_config (
48
39
self ,
@@ -71,7 +62,6 @@ def test_getcfg_and_config(
71
62
config = pytester .parseconfigure (str (sub ))
72
63
assert config .inicfg ["name" ] == "value"
73
64
74
- @setup_cfg_nowarn
75
65
def test_setupcfg_uses_toolpytest_with_pytest (self , pytester : Pytester ) -> None :
76
66
p1 = pytester .makepyfile ("def test(): pass" )
77
67
pytester .makefile (
@@ -1365,12 +1355,7 @@ def test_simple_noini(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None:
1365
1355
"pyproject.toml" , "[tool.pytest.ini_options]\n x=10" , id = "pyproject.toml"
1366
1356
),
1367
1357
pytest .param ("tox.ini" , "[pytest]\n x=10" , id = "tox.ini" ),
1368
- pytest .param (
1369
- "setup.cfg" ,
1370
- "[tool:pytest]\n x=10" ,
1371
- id = "setup.cfg" ,
1372
- marks = setup_cfg_nowarn ,
1373
- ),
1358
+ pytest .param ("setup.cfg" , "[tool:pytest]\n x=10" , id = "setup.cfg" ),
1374
1359
],
1375
1360
)
1376
1361
def test_with_ini (self , tmp_path : Path , name : str , contents : str ) -> None :
@@ -1503,7 +1488,6 @@ def test_with_existing_file_in_subdir(
1503
1488
assert rootpath == tmp_path
1504
1489
assert inipath is None
1505
1490
1506
- @setup_cfg_nowarn
1507
1491
def test_with_config_also_in_parent_directory (
1508
1492
self , tmp_path : Path , monkeypatch : MonkeyPatch
1509
1493
) -> None :
@@ -1521,10 +1505,7 @@ def test_with_config_also_in_parent_directory(
1521
1505
1522
1506
1523
1507
class TestOverrideIniArgs :
1524
- @pytest .mark .parametrize (
1525
- "name" ,
1526
- [pytest .param ("setup.cfg" , marks = setup_cfg_nowarn ), "tox.ini" , "pytest.ini" ],
1527
- )
1508
+ @pytest .mark .parametrize ("name" , "setup.cfg tox.ini pytest.ini" .split ())
1528
1509
def test_override_ini_names (self , pytester : Pytester , name : str ) -> None :
1529
1510
section = "[pytest]" if name != "setup.cfg" else "[tool:pytest]"
1530
1511
pytester .path .joinpath (name ).write_text (
0 commit comments