Systematic rename of all semantic anchors (#region, [DEF], @RELATION) across 1400+ files — backend Python, frontend Svelte/TS, specs, docs: - Flat anchors become Namespace.Module.Entity - @RELATION references updated to match new anchor paths - Zero business logic changes
54 lines
2.4 KiB
Python
54 lines
2.4 KiB
Python
# #region Test.Conftest.IntegrationTestConftest [C:3] [TYPE Module] [SEMANTICS test, conftest, fixtures, integration]
|
|
# @BRIEF Thin gating layer and plugin loader for integration test fixtures.
|
|
# @RELATION DISPATCHES -> [fixtures.network]
|
|
# @RELATION DISPATCHES -> [fixtures.postgres]
|
|
# @RELATION DISPATCHES -> [fixtures.pki]
|
|
# @RELATION DISPATCHES -> [fixtures.config]
|
|
# @RELATION DISPATCHES -> [fixtures.superset]
|
|
# @RATIONALE
|
|
# This file is intentionally thin. All fixture definitions have been moved
|
|
# to the fixtures/ package modules, loaded via pytest_plugins.
|
|
#
|
|
# Architecture:
|
|
# - pytest_plugins loads fixture modules from the fixtures/ subpackage.
|
|
# - pytest_collection_modifyitems handles the --run-integration skip logic.
|
|
# - Fixture modules are conftest-autodiscovery safe only via pytest_plugins.
|
|
#
|
|
# Why pytest_plugins instead of conftest_*.py auto-discovery:
|
|
# - conftest_*.py files are auto-discovered by pytest. Plugins loaded
|
|
# explicitly via pytest_plugins give us control over loading order and
|
|
# guarantee deterministic fixture resolution.
|
|
# - Fixture modules are plain Python modules (not conftest_* files)
|
|
# to avoid accidental double-loading if pytest directory scanning changes.
|
|
#
|
|
# @REJECTED
|
|
# Single monolithic conftest.py rejected — 793 lines with 15 fixtures
|
|
# and helpers was unmaintainable and violated module size limits.
|
|
# conftest_*.py auto-discovery rejected — loading order is implicit
|
|
# and fragile across pytest versions.
|
|
import pytest
|
|
|
|
# Load fixture plugin modules explicitly.
|
|
# These are NOT conftest_*.py files — they must be registered here to be discovered.
|
|
pytest_plugins = [
|
|
"tests.integration.fixtures.network",
|
|
"tests.integration.fixtures.postgres",
|
|
"tests.integration.fixtures.pki",
|
|
"tests.integration.fixtures.config",
|
|
"tests.integration.fixtures.superset",
|
|
]
|
|
|
|
|
|
# #region Test.Conftest.PytestCollectionModifyitems [C:1] [TYPE Function]
|
|
# @BRIEF Skip integration tests unless --run-integration is passed.
|
|
def pytest_collection_modifyitems(config, items):
|
|
if not config.getoption("--run-integration"):
|
|
skip_integration = pytest.mark.skip(reason="use --run-integration to run")
|
|
for item in items:
|
|
if "/integration/" in item.nodeid:
|
|
item.add_marker(skip_integration)
|
|
|
|
|
|
# #endregion Test.Conftest.PytestCollectionModifyitems
|
|
# #endregion Test.Conftest.IntegrationTestConftest
|