8000 little hack to make pip-cache-dir persist across tests · pythonanywhere/helper_scripts@c7c7734 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7c7734

Browse files
committed
little hack to make pip-cache-dir persist across tests
1 parent 43a2130 commit c7c7734

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ def _get_temp_dir():
1515

1616
@pytest.fixture(scope="session")
1717
def local_pip_cache():
18-
return _get_temp_dir()
18+
try:
19+
return next(Path(tempfile.gettempdir()).glob('*/test-pip-cache'))
20+
except StopIteration:
21+
return _get_temp_dir() / 'test-pip-cache'
1922

2023

2124
@pytest.fixture

0 commit comments

Comments
 (0)
0