Skip to content

Commit 9062822

Browse files
authored
MNT Use tmp_path fixture for test_check_memory (scikit-learn#31453)
1 parent bb56546 commit 9062822

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sklearn/utils/tests/test_validation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,9 +1161,10 @@ class WrongDummyMemory:
11611161
pass
11621162

11631163

1164-
def test_check_memory():
1165-
memory = check_memory("cache_directory")
1166-
assert memory.location == "cache_directory"
1164+
def test_check_memory(tmp_path):
1165+
cache_directory = str(tmp_path / "cache_directory")
1166+
memory = check_memory(cache_directory)
1167+
assert memory.location == cache_directory
11671168

11681169
memory = check_memory(None)
11691170
assert memory.location is None

0 commit comments

Comments
 (0)