Skip to content

Commit f01cfef

Browse files
authored
prevent test suite not cleaning tmp dirs (#342)
1 parent 8cfe98e commit f01cfef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_cache_control.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
Unit tests that verify our caching methods work correctly.
77
"""
88

9+
import os
910
import time
10-
from tempfile import mkdtemp
1111
from unittest.mock import ANY, Mock
1212

1313
import pytest
@@ -143,7 +143,7 @@ def test_update_cached_response_no_local_cache(self):
143143
result = cc.update_cached_response(req, resp)
144144
assert result is resp
145145

146-
def test_update_cached_response_with_valid_headers_separate_body(self):
146+
def test_update_cached_response_with_valid_headers_separate_body(self, tmp_path):
147147
"""
148148
If the local cache has the given URL ``update_cached_response()`` will:
149149
@@ -152,7 +152,7 @@ def test_update_cached_response_with_valid_headers_separate_body(self):
152152
153153
This is the version for a cache that stores a separate body.
154154
"""
155-
cache = SeparateBodyFileCache(mkdtemp())
155+
cache = SeparateBodyFileCache(os.fsdecode(tmp_path))
156156
self.update_cached_response_with_valid_headers_test(cache)
157157

158158
def test_update_cached_response_with_valid_headers(self):

0 commit comments

Comments
 (0)