Remove file after test completion

This commit is contained in:
Andrew Murray 2025-07-16 13:40:22 +10:00
parent 91bbeb5dcb
commit a426eb55af

View File

@ -276,6 +276,7 @@ class TestEmbeddable:
except Exception:
pytest.skip("Compiler could not be initialized")
try:
with open("embed_pil.c", "w", encoding="utf-8") as fh:
home = sys.prefix.replace("\\", "\\\\")
fh.write(
@ -315,3 +316,5 @@ int main(int argc, char* argv[])
process = subprocess.Popen(["embed_pil.exe"], env=env)
process.communicate()
assert process.returncode == 0
finally:
os.remove("embed_pil.c")