-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_check_status.py
More file actions
35 lines (29 loc) · 912 Bytes
/
_check_status.py
File metadata and controls
35 lines (29 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Check status of all problems."""
import subprocess
from pathlib import Path
solutions_dir = Path('solutions')
problems = sorted([f.stem for f in solutions_dir.glob('*.py') if not f.name.startswith('_')])
failing = []
passing = []
for problem in problems:
try:
result = subprocess.run(
['leetcode/Scripts/python.exe', 'runner/test_runner.py', problem],
capture_output=True,
timeout=30,
encoding='utf-8',
errors='replace'
)
stdout = result.stdout or ''
if 'FAIL' in stdout or result.returncode != 0:
failing.append(problem)
else:
passing.append(problem)
except Exception as e:
failing.append(problem)
print(f"Passing: {len(passing)}/45")
print(f"Failing: {len(failing)}")
if failing:
print("\nFailing problems:")
for p in failing:
print(f" - {p}")