From f6f8f277588a709b02ccb08b1d2fe929e827ce86 Mon Sep 17 00:00:00 2001 From: Bryce Willey Date: Wed, 15 Apr 2026 15:05:19 -0400 Subject: [PATCH] Add test that imports all other python modules Does have to ignore SystemExit exceptions that happen because `config.py` always tries to load, even if it's not running in the docker image. --- .gitignore | 1 + docassemble/AssemblyLine/test_all_imports.py | 12 ++++++++++++ pyproject.toml | 9 ++++----- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 docassemble/AssemblyLine/test_all_imports.py diff --git a/.gitignore b/.gitignore index af1e1baf..6ba9cd36 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ docassemble.AssemblyLine.egg-info/* **/.mypy_cache/** dist/** .venv/** +uv.lock # IDE related .vscode/** diff --git a/docassemble/AssemblyLine/test_all_imports.py b/docassemble/AssemblyLine/test_all_imports.py new file mode 100644 index 00000000..1a65a7d6 --- /dev/null +++ b/docassemble/AssemblyLine/test_all_imports.py @@ -0,0 +1,12 @@ +# Makes sure that loading each module file works. +# Includes all imports not covered by other test files. + +from .al_courts import * +from .custom_jinja_filters import * +from .language import * +from .sign import * + +try: + from .sessions import * +except SystemExit as ex: + print(f"Ignoring SystemExit error (expected from config.py: {ex})") diff --git a/pyproject.toml b/pyproject.toml index f1199981..65bb03fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,14 +65,13 @@ ignore_missing_imports = true [dependency-groups] dev = [ - "docassemble.base>=1.3", - "docassemble.webapp", - "pytest", + "docassemble.base>=1.7", + "docassemble.webapp>=1.7", + "pytest>=7.0", "mypy", "pandas-stubs", - "sqlalchemy[mypy]", + "sqlalchemy[mypy]>=1.3.0", "types-PyYAML", - "PyGithub", "types-requests", "types-psycopg2", ]