We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 952adda commit 3a7f7d3Copy full SHA for 3a7f7d3
python/tests/test_test_inputs.py
@@ -1,5 +1,6 @@
1
import os.path
2
import pkgutil
3
+import tempfile
4
from typing import List
5
6
import pytest
@@ -28,6 +29,14 @@ async def test_test_inputs(predictor):
28
29
30
# Some predictors calls current_scope() and requires ctx_pid
31
scope.ctx_pid.set(predictor)
- assert await r.test()
32
+
33
+ # Use temporary directory for predictors that create files
34
+ original_cwd = os.getcwd()
35
+ with tempfile.TemporaryDirectory() as temp_dir:
36
+ try:
37
+ os.chdir(temp_dir)
38
+ assert await r.test()
39
+ finally:
40
+ os.chdir(original_cwd)
41
except PythonVersionError as e:
42
pytest.skip(reason=str(e))
0 commit comments