Skip to content

Commit 91d9727

Browse files
test: assert production paths avoid print
1 parent b4eec6c commit 91d9727

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pathlib import Path
2+
3+
4+
PRODUCTION_ROOTS = (
5+
Path("quantara/web_app"),
6+
Path("quantara/soroban"),
7+
)
8+
9+
EXCLUDED_PARTS = {"tests", "test_integration", "__pycache__"}
10+
11+
12+
def test_production_python_paths_do_not_use_print():
13+
offenders: list[str] = []
14+
15+
for root in PRODUCTION_ROOTS:
16+
for path in root.rglob("*.py"):
17+
if any(part in EXCLUDED_PARTS for part in path.parts):
18+
continue
19+
text = path.read_text(encoding="utf-8")
20+
if "print(" in text:
21+
offenders.append(str(path))
22+
23+
assert offenders == []

0 commit comments

Comments
 (0)