Simplify test_pytest_plugins_in_non_top_level_conftest_deprecated

This commit is contained in:
Bruno Oliveira 2018-09-26 10:49:14 -03:00
parent b1fbb2ab92
commit ba5630e0f8
1 changed files with 4 additions and 13 deletions

View File

@ -178,21 +178,12 @@ def test_pytest_catchlog_deprecated(testdir, plugin):
def test_pytest_plugins_in_non_top_level_conftest_deprecated(testdir): def test_pytest_plugins_in_non_top_level_conftest_deprecated(testdir):
from _pytest.deprecated import PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST from _pytest.deprecated import PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST
subdirectory = testdir.tmpdir.join("subdirectory") testdir.makepyfile(
subdirectory.mkdir() **{
# create the inner conftest with makeconftest and then move it to the subdirectory "subdirectory/conftest.py": """
testdir.makeconftest(
"""
pytest_plugins=['capture'] 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( testdir.makepyfile(
""" """