IceS2 49df5fc9de
MINOR: Implement dependency injection on ingestion (#21719)
* Initial implementation for our Connection Class

* Implement the Initial Connection class

* Add Unit Tests

* Implement Dependency Injection for the Ingestion Framework

* Fix Test

* Fix Profile Test Connection

* Fix test, making the injection test run last

* Update connections.py

* Changed NewType to an AbstractClass to avoid linting issues

* remove comment

* Fix bug in service spec

* Update PyTest version to avoid importlib.reader wrong import
2025-06-16 08:03:38 +02:00

31 lines
892 B
Python

def pytest_pycollect_makeitem(collector, name, obj):
try:
if obj.__name__ in ("TestSuiteSource", "TestSuiteInterfaceFactory"):
return []
if obj.__base__.__name__ in ("BaseModel", "Enum"):
return []
except AttributeError:
pass
def pytest_collection_modifyitems(session, config, items):
"""Reorder test items to ensure certain files run last."""
# List of test files that should run last
last_files = [
"test_dependency_injector.py",
# Add other files that should run last here
]
# Get all test items that should run last
last_items = []
other_items = []
for item in items:
if any(file in item.nodeid for file in last_files):
last_items.append(item)
else:
other_items.append(item)
# Reorder the items
items[:] = other_items + last_items