From f48b32cd658da1e1471716ba8a40269bb1f1b84a Mon Sep 17 00:00:00 2001 From: user Date: Sun, 15 Feb 2026 06:18:06 +0100 Subject: [PATCH] fix: resolve test_crtsh.py import for plugins/ directory Same importlib fix as test_username.py -- load plugins.crtsh from file path since plugins/ is not a Python package. Co-Authored-By: Claude Opus 4.6 --- tests/test_crtsh.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_crtsh.py b/tests/test_crtsh.py index 08cf8fe..5f427fc 100644 --- a/tests/test_crtsh.py +++ b/tests/test_crtsh.py @@ -1,8 +1,19 @@ """Tests for the crt.sh certificate transparency plugin.""" +import importlib.util +import sys from datetime import datetime, timezone +from pathlib import Path -from plugins.crtsh import ( +# plugins/ is not a Python package -- load the module from file path +_spec = importlib.util.spec_from_file_location( + "plugins.crtsh", Path(__file__).resolve().parent.parent / "plugins" / "crtsh.py", +) +_mod = importlib.util.module_from_spec(_spec) +sys.modules[_spec.name] = _mod +_spec.loader.exec_module(_mod) + +from plugins.crtsh import ( # noqa: E402 deduplicate, format_result, is_expired,