From 22bb43413ff94dc6df43b5e75a7c142d1ca351f9 Mon Sep 17 00:00:00 2001 From: RedBeardCode Date: Thu, 14 Jul 2016 09:14:19 +0200 Subject: [PATCH] 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 --- testing/python/fixture.py | 3 ++- testing/test_conftest.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index e2bca5286..e7232a25f 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -1586,7 +1586,8 @@ class TestAutouseManagement: def test_2(self): pass """) - reprec = testdir.inline_run("-v","-s") + confcut = "--confcutdir={0}".format(testdir.tmpdir) + reprec = testdir.inline_run("-v","-s", confcut) reprec.assertoutcome(passed=8) config = reprec.getcalls("pytest_unconfigure")[0].config l = config.pluginmanager._getconftestmodules(p)[0].l diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 6f5e77f6d..90db7835c 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -203,6 +203,7 @@ def test_conftest_import_order(testdir, monkeypatch): def impct(p): return p conftest = PytestPluginManager() + conftest._confcutdir = testdir.tmpdir monkeypatch.setattr(conftest, '_importconftest', impct) assert conftest._getconftestmodules(sub) == [ct1, ct2]