Merge pull request #1730 from RedBeardCode/pytest-1536

Added confcutdir in testing/test_conftest.py::test_conftest_import_or…
This commit is contained in:
Bruno Oliveira 2016-07-14 17:02:58 -03:00 committed by GitHub
commit 350ebc9167
2 changed files with 3 additions and 1 deletions

View File

@ -1586,7 +1586,8 @@ class TestAutouseManagement:
def test_2(self): def test_2(self):
pass pass
""") """)
reprec = testdir.inline_run("-v","-s") confcut = "--confcutdir={0}".format(testdir.tmpdir)
reprec = testdir.inline_run("-v","-s", confcut)
reprec.assertoutcome(passed=8) reprec.assertoutcome(passed=8)
config = reprec.getcalls("pytest_unconfigure")[0].config config = reprec.getcalls("pytest_unconfigure")[0].config
l = config.pluginmanager._getconftestmodules(p)[0].l l = config.pluginmanager._getconftestmodules(p)[0].l

View File

@ -203,6 +203,7 @@ def test_conftest_import_order(testdir, monkeypatch):
def impct(p): def impct(p):
return p return p
conftest = PytestPluginManager() conftest = PytestPluginManager()
conftest._confcutdir = testdir.tmpdir
monkeypatch.setattr(conftest, '_importconftest', impct) monkeypatch.setattr(conftest, '_importconftest', impct)
assert conftest._getconftestmodules(sub) == [ct1, ct2] assert conftest._getconftestmodules(sub) == [ct1, ct2]