remove pytest namespace hook

This commit is contained in:
Ronny Pfannschmidt
2018-11-19 14:02:37 +01:00
parent 62967b3110
commit ba17363d75
5 changed files with 1 additions and 80 deletions

View File

@@ -59,37 +59,6 @@ class TestPytestPluginInteractions(object):
assert res.ret != 0
res.stderr.fnmatch_lines(["*did not find*sys*"])
def test_namespace_early_from_import(self, testdir):
p = testdir.makepyfile(
"""
from pytest import Item
from pytest import Item as Item2
assert Item is Item2
"""
)
result = testdir.runpython(p)
assert result.ret == 0
@pytest.mark.filterwarnings("ignore:pytest_namespace is deprecated")
def test_do_ext_namespace(self, testdir):
testdir.makeconftest(
"""
def pytest_namespace():
return {'hello': 'world'}
"""
)
p = testdir.makepyfile(
"""
from pytest import hello
import pytest
def test_hello():
assert hello == "world"
assert 'hello' in pytest.__all__
"""
)
reprec = testdir.inline_run(p)
reprec.assertoutcome(passed=1)
def test_do_option_postinitialize(self, testdir):
config = testdir.parseconfigure()
assert not hasattr(config.option, "test123")
@@ -190,17 +159,6 @@ class TestPytestPluginInteractions(object):
assert "deprecated" in warnings[-1]
def test_namespace_has_default_and_env_plugins(testdir):
p = testdir.makepyfile(
"""
import pytest
pytest.mark
"""
)
result = testdir.runpython(p)
assert result.ret == 0
def test_default_markers(testdir):
result = testdir.runpytest("--markers")
result.stdout.fnmatch_lines(["*tryfirst*first*", "*trylast*last*"])