Fixing everything, making the project structure ready for real code.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
"""Pytest configuration for automatic typeguard integration."""
|
||||
|
||||
from typeguard import install_import_hook
|
||||
|
||||
def pytest_configure(config):
|
||||
|
||||
def pytest_configure(config) -> None: # noqa: ARG001
|
||||
"""Configure pytest to use typeguard automatically."""
|
||||
# This enables typeguard for all functions with type hints
|
||||
# without requiring @typechecked decorators
|
||||
pass
|
||||
# Install typeguard import hook to automatically check all functions
|
||||
# with type hints in the backend package during test runs
|
||||
install_import_hook("backend")
|
||||
|
||||
# Also check any other packages in src/
|
||||
install_import_hook("src")
|
||||
|
||||
print("🛡️ Automatic typeguard hooks installed for test run")
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
"""Set up typeguard for each test run."""
|
||||
# Import hook is automatically enabled via --typeguard-packages
|
||||
# The import hook is automatically enabled via pytest_configure
|
||||
# All functions with type hints will be automatically checked
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user