fix mypy type narrowing in test_cli_security
Some checks failed
CI / Security Scan (push) Failing after 22s
CI / Lint & Format (push) Successful in 24s
CI / Security Tests (push) Has been skipped
CI / Memory Leak Check (push) Successful in 22s
CI / SBOM Generation (push) Failing after 21s
CI / Unit Tests (push) Successful in 36s
Some checks failed
CI / Security Scan (push) Failing after 22s
CI / Lint & Format (push) Successful in 24s
CI / Security Tests (push) Has been skipped
CI / Memory Leak Check (push) Successful in 22s
CI / SBOM Generation (push) Failing after 21s
CI / Unit Tests (push) Successful in 36s
This commit is contained in:
@@ -18,7 +18,10 @@ def load_fpaste_module():
|
||||
)
|
||||
if spec is None or spec.loader is None:
|
||||
pytest.skip("Could not load fpaste module")
|
||||
return None # unreachable, but helps mypy
|
||||
|
||||
assert spec is not None # mypy: narrow type after skip
|
||||
assert spec.loader is not None
|
||||
fpaste = importlib.util.module_from_spec(spec)
|
||||
sys.modules["fpaste"] = fpaste
|
||||
spec.loader.exec_module(fpaste)
|
||||
|
||||
Reference in New Issue
Block a user