Replace brittle explicit method-by-method proxy with __getattr__-based dynamic proxy that forwards all args/kwargs to the inner repo. Fixes TypeError on get_logs_after_id() where concrete repo accepts extra kwargs beyond the ABC signature. Pin DECNET_DEVELOPER_TRACING=false in conftest.py so .env.local settings don't leak into the test suite.
22 lines
698 B
Python
22 lines
698 B
Python
"""
|
|
Shared pytest configuration.
|
|
|
|
Env vars required by decnet.env must be set here, at module level, before
|
|
any test file imports decnet.* — pytest loads conftest.py first.
|
|
"""
|
|
import os
|
|
|
|
os.environ["DECNET_JWT_SECRET"] = "stable-test-secret-key-at-least-32-chars-long"
|
|
os.environ["DECNET_ADMIN_PASSWORD"] = "test-password-123"
|
|
os.environ["DECNET_DEVELOPER"] = "true"
|
|
os.environ["DECNET_DEVELOPER_TRACING"] = "false"
|
|
os.environ["DECNET_DB_TYPE"] = "sqlite"
|
|
|
|
import pytest
|
|
from typing import Any
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def standardize_auth_secret(monkeypatch: Any) -> None:
|
|
import decnet.web.auth
|
|
monkeypatch.setattr(decnet.web.auth, "SECRET_KEY", os.environ["DECNET_JWT_SECRET"])
|