Skip to content

Commit 8770039

Browse files
authored
Create test for main.py execution
1 parent 58133db commit 8770039

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import subprocess
2+
import sys
3+
import os
4+
5+
def test_main_runs():
6+
"""Check that main.py runs without errors."""
7+
result = subprocess.run(
8+
[sys.executable, os.path.join(os.path.dirname(__file__), "..", "main.py")],
9+
capture_output=True,
10+
text=True
11+
)
12+
# Assert that the script exits successfully
13+
assert result.returncode == 0, f"main.py failed with error:\n{result.stderr}"

0 commit comments

Comments
 (0)