fixed typeguard usage w/ burnettk
This commit is contained in:
parent
cf2054458f
commit
8fd3e14935
|
@ -61,7 +61,10 @@ jobs:
|
|||
database: "sqlite",
|
||||
}
|
||||
- {
|
||||
python: "3.10",
|
||||
# typeguard 2.13.3 is broken with TypeDict in 3.10.
|
||||
# probably the next release fixes it.
|
||||
# https://github.com/agronholm/typeguard/issues/242
|
||||
python: "3.9",
|
||||
os: "ubuntu-latest",
|
||||
session: "typeguard",
|
||||
database: "sqlite",
|
||||
|
|
10
conftest.py
10
conftest.py
|
@ -3,8 +3,16 @@ import os
|
|||
|
||||
import pytest
|
||||
from flask.app import Flask
|
||||
from typeguard.importhook import install_import_hook
|
||||
|
||||
from spiff_workflow_webapp import create_app
|
||||
|
||||
# We need to call this before importing spiff_workflow_webapp
|
||||
# otherwise typeguard cannot work. hence the noqa: E402
|
||||
if os.environ.get("RUN_TYPEGUARD") == "true":
|
||||
install_import_hook(packages="spiff_workflow_webapp")
|
||||
|
||||
|
||||
from spiff_workflow_webapp import create_app # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
|
@ -156,7 +156,8 @@ def typeguard(session: Session) -> None:
|
|||
"""Runtime type checking using Typeguard."""
|
||||
session.install(".")
|
||||
session.install("pytest", "typeguard", "pygments")
|
||||
session.run("pytest", f"--typeguard-packages={package}", *session.posargs)
|
||||
session.env["RUN_TYPEGUARD"] = "true"
|
||||
session.run("pytest", *session.posargs)
|
||||
|
||||
|
||||
@session(python=python_versions)
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue