Skip to content

Commit 22bb434

Browse files
committed
Added confcutdir in testing/test_conftest.py::test_conftest_import_order and
testing/python/fixture.py::TestAutouseManagement::():: test_class_function_parametrization_finalization to avoid problems with abandoned conftest.py files in /tmp dir. Fixes #1536
1 parent 1fb09d9 commit 22bb434

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

testing/python/fixture.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ class TestClass2:
15861586
def test_2(self):
15871587
pass
15881588
""")
1589-
reprec = testdir.inline_run("-v","-s")
1589+
confcut = "--confcutdir={0}".format(testdir.tmpdir)
1590+
reprec = testdir.inline_run("-v","-s", confcut)
15901591
reprec.assertoutcome(passed=8)
15911592
config = reprec.getcalls("pytest_unconfigure")[0].config
15921593
l = config.pluginmanager._getconftestmodules(p)[0].l

testing/test_conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def test_conftest_import_order(testdir, monkeypatch):
203203
def impct(p):
204204
return p
205205
conftest = PytestPluginManager()
206+
conftest._confcutdir = testdir.tmpdir
206207
monkeypatch.setattr(conftest, '_importconftest', impct)
207208
assert conftest._getconftestmodules(sub) == [ct1, ct2]
208209

0 commit comments

Comments
 (0)