test: implement mock OAuth2 server infrastructure for auth testing
- Add MockOAuth2ServerContainer using testcontainers - Create conftest_oauth.py with OAuth test fixtures - Add comprehensive OAuth integration tests - Support both mock (default) and real (CI secrets) OAuth modes - Add documentation for OAuth testing setup Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -279,3 +279,27 @@ def pytest_configure(config):
|
||||
config.addinivalue_line("markers", "requires_redis: Tests requiring Redis")
|
||||
config.addinivalue_line("markers", "requires_docker: Tests requiring Docker")
|
||||
config.addinivalue_line("markers", "e2e: End-to-end tests with full infrastructure")
|
||||
|
||||
# Import OAuth fixtures (must be at end to avoid circular imports)
|
||||
try:
|
||||
from tests.conftest_oauth import (
|
||||
mock_oauth_server,
|
||||
oauth_config,
|
||||
oauth_enabled_app,
|
||||
oauth_test_token,
|
||||
test_user_info,
|
||||
use_real_oauth,
|
||||
)
|
||||
|
||||
# Make fixtures available
|
||||
__all__ = [
|
||||
"mock_oauth_server",
|
||||
"oauth_config",
|
||||
"oauth_enabled_app",
|
||||
"oauth_test_token",
|
||||
"test_user_info",
|
||||
"use_real_oauth",
|
||||
]
|
||||
except ImportError:
|
||||
# OAuth fixtures not available (testcontainers may not be installed)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user