basic working mvp
This commit is contained in:
2026-10-07 15:12:38 +03:00
parent 785a6980f6
commit fac12b2ea8
24 changed files with 1696 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
"""Проверки исходников, которые работают даже при ошибках импорта сервера."""
import ast
from pathlib import Path
def test_all_python_sources_compile():
"""Проверяет синтаксис всех серверных модулей и клиента без запуска и записи pyc."""
errors = []
for path in sorted((Path(__file__).parents[1] / "src").rglob("*.py")):
try:
compile(path.read_text(encoding="utf-8"), str(path), "exec")
except SyntaxError as error:
errors.append(f"{path.relative_to(Path(__file__).parents[1])}:{error.lineno}: {error.msg}")
assert not errors, "\n".join(errors)
def test_every_test_has_a_description():
"""Проверяет наличие краткого docstring у каждого теста набора."""
missing = []
for path in Path(__file__).parent.glob("test_*.py"):
tree = ast.parse(path.read_text(encoding="utf-8"))
for node in ast.walk(tree):
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name.startswith("test_"):
if not ast.get_docstring(node):
missing.append(f"{path.name}:{node.lineno}: {node.name}")
assert not missing, "\n".join(missing)