From de39a3617409ca956c34f5cb39a673b1f0423077 Mon Sep 17 00:00:00 2001 From: Username Date: Thu, 25 Dec 2025 20:49:27 +0100 Subject: [PATCH] fix mypy type narrowing in test_cli_security --- tests/test_cli_security.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_cli_security.py b/tests/test_cli_security.py index ec9a7ea..16ce614 100644 --- a/tests/test_cli_security.py +++ b/tests/test_cli_security.py @@ -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)