From ba5630e0f8fd35a3a8e98b5dee9572832198bc82 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 26 Sep 2018 10:49:14 -0300 Subject: [PATCH] Simplify test_pytest_plugins_in_non_top_level_conftest_deprecated --- testing/deprecated_test.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) 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( """