File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 55
66def pytest_configure (config ):
77 config .addinivalue_line ("markers" , "interpreter: indicate whether interpreter supports the test" )
8+ worker_id = os .getenv ("PYTEST_XDIST_WORKER" )
9+ # On Windows, use a dedicated Triton cache per pytest worker to avoid PermissionError.
10+ if os .name == "nt" and worker_id :
11+ os .environ ["TRITON_CACHE_DIR" ] = tempfile .mkdtemp (prefix = "triton-" )
12+ if os .name == "nt" :
13+ pytest .mark .forked = pytest .mark .skip (reason = "Windows doesn't fork" )
814
915
1016def pytest_addoption (parser ):
@@ -27,12 +33,3 @@ def fresh_triton_cache():
2733 yield tmpdir
2834 finally :
2935 os .environ .pop ("TRITON_CACHE_DIR" , None )
30-
31-
32- def pytest_configure (config ):
33- worker_id = os .getenv ("PYTEST_XDIST_WORKER" )
34- # On Windows, use a dedicated Triton cache per pytest worker to avoid PermissionError.
35- if os .name == "nt" and worker_id :
36- os .environ ["TRITON_CACHE_DIR" ] = tempfile .mkdtemp (prefix = "triton-" )
37- if os .name == "nt" :
38- pytest .mark .forked = pytest .mark .skip (reason = "Windows doesn't fork" )
You can’t perform that action at this time.
0 commit comments