fix(test): Skip pty and termios tests on Windows

- Added `pytest.importorskip` calls for `pty` and `termios` to `src/tests/test_ai_tui_agent_harness.py`.
- Formatted `torch/scripts/test-audit/run_python_static_analysis.py` and `torch/scripts/test-audit/run_python_flaky_check.py` using `black`.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-28 02:05:31 +00:00
1 parent 228cdee71e
commit a3b8a91977
4 files changed
+68 -27

No files matched your search

@@ -20,29 +20,33 @@ PATTERNS = [
(r"# todo", "Found '# todo' comment"),
]
def scan_file(filepath):
"""Scan a single file for suspicious patterns."""
issues = []
try:
content = filepath.read_text(encoding="utf-8")
except Exception:
return # Skip non-text files
return # Skip non-text files
for pattern, message in PATTERNS:
if re.search(pattern, content):
issues.append(message)
# Check for lack of assertions (very naive)
if "test_" in filepath.name and "assert" not in content and "expect" not in content and "raise" not in content:
if (
"test_" in filepath.name
and "assert" not in content
and "expect" not in content
and "raise" not in content
):
# Exclude conftest or helpers
if "conftest" not in filepath.name and "helper" not in filepath.name:
issues.append("No obvious assertions found")
issues.append("No obvious assertions found")
if issues:
SUSPICIOUS.append({
"file": str(filepath),
"issues": issues
})
SUSPICIOUS.append({"file": str(filepath), "issues": issues})
def main():
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
@@ -62,5 +66,6 @@ def main():
print(f"Found {len(SUSPICIOUS)} suspicious files.")
print(f"Report written to {OUTPUT_DIR / 'suspicious-tests.json'}.")
if __name__ == "__main__":
main()