From d5bbe37495ee733be5f78de72364f3ec48ed7a0d Mon Sep 17 00:00:00 2001 From: drebs Date: Sat, 24 Sep 2016 11:32:13 -0300 Subject: [test] use pytest tmpdir fixture in all tests Tests that were imported from u1db or created on top of that structure were leaving temporary directories behind. This could cause problems in test servers, either by filling the partition or by extrapolating the maximum amount of files in a directory. This commit replaces all usages of temporary directories in the old test structure by pytest tmpdir fixture, which properly cares for removing temporary directories. --- testing/tests/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testing/tests/conftest.py') diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py index 3be9ba2a..9e4319ac 100644 --- a/testing/tests/conftest.py +++ b/testing/tests/conftest.py @@ -11,3 +11,8 @@ def pytest_addoption(parser): def couch_url(request): url = request.config.getoption('--couch-url') request.cls.couch_url = url + + +@pytest.fixture +def method_tmpdir(request, tmpdir): + request.instance.tempdir = tmpdir.strpath -- cgit v1.2.3