mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
fix: Use separate temp file for log in editor test script
This commit is contained in:
parent
6ecf44c87a
commit
3fd4a2841a
1 changed files with 4 additions and 3 deletions
|
@ -88,8 +88,10 @@ def test_pipe_editor_with_fake_editor():
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
with tempfile.NamedTemporaryFile(mode="w", suffix=".log", delete=False) as log_f:
|
||||||
|
log_path = log_f.name
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
|
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
|
||||||
log_path = f.name + ".log"
|
|
||||||
f.write(f"""import sys
|
f.write(f"""import sys
|
||||||
with open("{log_path}", "w") as f:
|
with open("{log_path}", "w") as f:
|
||||||
f.write(" ".join(sys.argv))
|
f.write(" ".join(sys.argv))
|
||||||
|
@ -112,8 +114,7 @@ with open("{log_path}", "w") as f:
|
||||||
finally:
|
finally:
|
||||||
# Clean up
|
# Clean up
|
||||||
os.unlink(script_path)
|
os.unlink(script_path)
|
||||||
if os.path.exists(f"{script_path}.log"):
|
os.unlink(log_path)
|
||||||
os.unlink(f"{script_path}.log")
|
|
||||||
|
|
||||||
|
|
||||||
def test_pipe_editor():
|
def test_pipe_editor():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue