tests: remove file with invalid syntax

This commit is contained in:
Maximilian Hils 2022-10-10 02:39:34 +02:00
parent 360ac36666
commit c2e8987c5f
2 changed files with 3 additions and 9 deletions

View File

@ -19,7 +19,7 @@ from mitmproxy.tools import main
script.ReloadInterval = 0.1
def test_load_script(tdata, caplog):
def test_load_script(tmp_path, tdata, caplog):
ns = script.load_script(
tdata.path("mitmproxy/data/addonscripts/recorder/recorder.py")
)
@ -28,7 +28,8 @@ def test_load_script(tdata, caplog):
script.load_script("nonexistent")
assert "No such file or directory" in caplog.text
script.load_script(tdata.path("mitmproxy/data/addonscripts/recorder/error.py"))
(tmp_path / "error.py").write_text("this is invalid syntax")
script.load_script(str(tmp_path / "error.py"))
assert "invalid syntax" in caplog.text

View File

@ -1,7 +0,0 @@
"""
This file is intended to have syntax errors for test purposes
"""
impotr recorder # Intended Syntax Error
addons = [recorder.Recorder("e")]