mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 00:46:22 +02:00
Fix test suite Prometheus registry pollution and remove default coverage
The test_metrics.py fixture (added in 4e63dbda) deleted
class-level metric singleton attributes without restoring them. This
stripped the hasattr() guards that prevent duplicate Prometheus
registration, so every subsequent Processor construction in the test
run raised ValueError: Duplicated timeseries. Fix by saving and
restoring the original attributes around each test.
Remove --cov=trustgraph from pytest.ini defaults — the coverage
import hooks interact badly with the trustgraph namespace package,
causing duplicate class loading. Coverage can still be requested
explicitly via the command line.
20 lines
No EOL
567 B
INI
20 lines
No EOL
567 B
INI
[pytest]
|
|
testpaths = tests
|
|
python_paths = .
|
|
python_files = test_*.py
|
|
python_classes = Test*
|
|
python_functions = test_*
|
|
addopts =
|
|
-v
|
|
--tb=short
|
|
--strict-markers
|
|
--disable-warnings
|
|
# --cov-fail-under=80
|
|
asyncio_mode = auto
|
|
markers =
|
|
slow: marks tests as slow (deselect with '-m "not slow"')
|
|
integration: marks tests as integration tests
|
|
unit: marks tests as unit tests
|
|
contract: marks tests as contract tests (service interface validation)
|
|
vertexai: marks tests as vertex ai specific tests
|
|
asyncio: marks tests that use asyncio |