From e5ea32a44a1a51fedaf6f2850cbca9538aa9219f Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 13 Jul 2026 15:24:13 +0800 Subject: [PATCH] build(pytest): use importlib import mode to fix app test collection apps/cloud-api/tests and apps/device-host-agent/tests both contain test_app.py without __init__.py, so pytest's default prepend mode collided on the bare module name and aborted collection when Jenkins passed both paths together. Switching to importlib imports each file by its full path and avoids the collision. Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 88e9a19..c9cf96b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ include = [ [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "-ra" +addopts = "-ra --import-mode=importlib" markers = [ "integration: tests requiring external hardware or services", ]