diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index fbaca4e30..974450044 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -178,21 +178,12 @@ def test_pytest_catchlog_deprecated(testdir, plugin): def test_pytest_plugins_in_non_top_level_conftest_deprecated(testdir): from _pytest.deprecated import PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST - subdirectory = testdir.tmpdir.join("subdirectory") - subdirectory.mkdir() - # create the inner conftest with makeconftest and then move it to the subdirectory - testdir.makeconftest( - """ + testdir.makepyfile( + **{ + "subdirectory/conftest.py": """ pytest_plugins=['capture'] """ - ) - testdir.tmpdir.join("conftest.py").move(subdirectory.join("conftest.py")) - # make the top level conftest - testdir.makeconftest( - """ - import warnings - warnings.filterwarnings('always', category=DeprecationWarning) - """ + } ) testdir.makepyfile( """