Skip to content

Commit fc96fd8

Browse files
authored
fixing main test (#57)
* fixing main test * better
1 parent 7482772 commit fc96fd8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_main.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
from pathlib import Path
21
import subprocess
2+
import sys
3+
from pathlib import Path
4+
35
import pytest
46

57

68
@pytest.mark.pricy
79
def test_main_script_execution():
810
# this should trigger agent_4o_mini on miniwob_tiny_test unless this was
911
# reconfigured differently.
10-
script_path = Path(__file__).parent.parent / "main.py"
12+
path = Path(__file__).parent.parent / "main.py"
13+
14+
sys.path.insert(0, str(path.parent))
1115

1216
# just make sure it's in the right state
13-
main = __import__(script_path.stem)
17+
main = __import__(path.stem)
1418
assert main.benchmark == "miniwob_tiny_test"
1519
assert main.reproducibility_mode == False
1620
assert main.relaunch == False
1721
assert main.n_jobs <= 10
1822

19-
result = subprocess.run(["python", script_path], capture_output=True, text=True, timeout=5 * 60)
23+
result = subprocess.run(["python", str(path)], capture_output=True, text=True, timeout=5 * 60)
2024
assert result.returncode == 0
2125

2226

0 commit comments

Comments
 (0)