From 077001fe5c0522381c236d6d28f0f232ad9b4286 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 22 Feb 2020 23:31:08 +0100 Subject: [PATCH] tests: simplify test_pytest_plugins_in_non_top_level_conftest_unsupported_no_false_positives --- testing/test_config.py | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index 9f6042e4b..18e4c388f 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1450,27 +1450,16 @@ class TestPytestPluginsVariable: def test_pytest_plugins_in_non_top_level_conftest_unsupported_no_false_positives( self, testdir ): - subdirectory = testdir.tmpdir.join("subdirectory") - subdirectory.mkdir() - testdir.makeconftest( - """ - pass - """ - ) - testdir.tmpdir.join("conftest.py").move(subdirectory.join("conftest.py")) - - testdir.makeconftest( - """ - import warnings - warnings.filterwarnings('always', category=DeprecationWarning) - pytest_plugins=['capture'] - """ - ) testdir.makepyfile( - """ - def test_func(): - pass - """ + "def test_func(): pass", + **{ + "subdirectory/conftest": "pass", + "conftest": """ + import warnings + warnings.filterwarnings('always', category=DeprecationWarning) + pytest_plugins=['capture'] + """, + } ) res = testdir.runpytest_subprocess() assert res.ret == 0