Use Ruff for from __future__ import annotations checks (#10910)

This commit is contained in:
Avasam
2023-10-19 05:40:41 -04:00
committed by GitHub
parent 3cb1a8faed
commit 21fcd8960f
5 changed files with 18 additions and 9 deletions

View File

@@ -83,9 +83,6 @@ def check_test_cases() -> None:
bad_test_case_filename = 'Files in a `test_cases` directory must have names starting with "check_"; got "{}"'
for file in testcase_dir.rglob("*.py"):
assert file.stem.startswith("check_"), bad_test_case_filename.format(file)
with open(file, encoding="UTF-8") as f:
lines = {line.strip() for line in f}
assert "from __future__ import annotations" in lines, "Test-case files should use modern typing syntax where possible"
def check_no_symlinks() -> None: