diff options
author | drebs <drebs@leap.se> | 2016-09-24 11:32:13 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-09-30 09:08:03 -0300 |
commit | d5bbe37495ee733be5f78de72364f3ec48ed7a0d (patch) | |
tree | a23ed57a323bd9e8db088700970d0f6f53e1da91 /testing/tests/server | |
parent | b1a7b538ab851c9e1aab3be5ba31411d658a4773 (diff) |
[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.
Diffstat (limited to 'testing/tests/server')
-rw-r--r-- | testing/tests/server/test_server.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/testing/tests/server/test_server.py b/testing/tests/server/test_server.py index 49d25ed0..18f92d88 100644 --- a/testing/tests/server/test_server.py +++ b/testing/tests/server/test_server.py @@ -20,7 +20,7 @@ Tests for server-related functionality. import binascii import mock import os -import tempfile +import pytest from hashlib import sha512 from pkg_resources import resource_filename @@ -287,6 +287,7 @@ class ServerAuthorizationTestCase(BaseSoledadTest): self._make_environ('/%s/sync-from/x' % dbname, 'POST'))) +@pytest.mark.usefixtures("method_tmpdir") class EncryptedSyncTestCase( CouchDBTestCase, TestCaseWithServer): @@ -349,11 +350,7 @@ class EncryptedSyncTestCase( return self.make_app_with_state(self.request_state) def setUp(self): - # the order of the following initializations is crucial because of - # dependencies. - # XXX explain better CouchDBTestCase.setUp(self) - self.tempdir = tempfile.mkdtemp(prefix="leap_tests-") TestCaseWithServer.setUp(self) def tearDown(self): |