Summary
In numbast/src/numbast/experimental/mlir/static/tests/test_conflict_shim_names.py, the test_conflict_func_names test writes generated source files to hardcoded /tmp paths:
with open("/tmp/conflict_func_name_1.py", "w") as f:
f.write(res1["src"])
with open("/tmp/conflict_func_name_2.py", "w") as f:
f.write(res2["src"])
This can lead to cross-test collisions and makes incorrect assumptions about the target platform (e.g., Windows does not have /tmp).
Suggested Fix
Use pytest's tmp_path fixture to isolate each test run:
def test_conflict_func_names(make_binding, tmp_path):
...
with open(tmp_path / "conflict_func_name_1.py", "w") as f:
f.write(res1["src"])
with open(tmp_path / "conflict_func_name_2.py", "w") as f:
f.write(res2["src"])
References
/cc @isVoid
Summary
In
numbast/src/numbast/experimental/mlir/static/tests/test_conflict_shim_names.py, thetest_conflict_func_namestest writes generated source files to hardcoded/tmppaths:This can lead to cross-test collisions and makes incorrect assumptions about the target platform (e.g., Windows does not have
/tmp).Suggested Fix
Use pytest's
tmp_pathfixture to isolate each test run:References
/cc @isVoid