30 lines
765 B
Python
30 lines
765 B
Python
"""
|
|
Contract Tests Configuration
|
|
|
|
Supports two testing modes via CONTRACT_TEST_MODE environment variable:
|
|
|
|
# Fast mode (default) - Django test client, test DB
|
|
pytest tests/contracts/
|
|
|
|
# Live mode - Real HTTP with LiveServerTestCase, test DB
|
|
CONTRACT_TEST_MODE=live pytest tests/contracts/
|
|
"""
|
|
|
|
import os
|
|
import pytest
|
|
|
|
# Let pytest-django handle Django setup via pytest.ini DJANGO_SETTINGS_MODULE
|
|
|
|
|
|
def pytest_configure(config):
|
|
"""Register custom markers"""
|
|
config.addinivalue_line(
|
|
"markers", "workflow: marks test as a workflow/flow test (runs endpoint tests in sequence)"
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def contract_test_mode():
|
|
"""Return current test mode"""
|
|
return os.environ.get("CONTRACT_TEST_MODE", "api")
|