tests: ensure cleanup with configs via get_config()
Also done in test_pluginmanager, although no resource warnings are there at least. Fixes https://github.com/pytest-dev/pytest/issues/4355.
This commit is contained in:
@@ -375,6 +375,15 @@ def testdir(request, tmpdir_factory):
|
||||
return Testdir(request, tmpdir_factory)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def _config_for_test():
|
||||
from _pytest.config import get_config
|
||||
|
||||
config = get_config()
|
||||
yield config
|
||||
config._ensure_unconfigure() # cleanup, e.g. capman closing tmpfiles.
|
||||
|
||||
|
||||
rex_outcome = re.compile(r"(\d+) ([\w-]+)")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user