Configure pytest with custom settings.
(config)
| 12 | sys.path.insert(0, os.path.dirname(__file__)) |
| 13 | |
| 14 | def pytest_configure(config): |
| 15 | """Configure pytest with custom settings.""" |
| 16 | # Mock external dependencies that might not be available |
| 17 | mock_modules = [ |
| 18 | 'uvicorn', |
| 19 | 'fastapi', |
| 20 | 'mcp.server.fastmcp', |
| 21 | 'mcp.server.sse', |
| 22 | 'pymetasploit3.msfrpc', |
| 23 | 'starlette.applications', |
| 24 | 'starlette.routing', |
| 25 | 'mcp.server.session' |
| 26 | ] |
| 27 | |
| 28 | for module in mock_modules: |
| 29 | if module not in sys.modules: |
| 30 | sys.modules[module] = Mock() |
| 31 | |
| 32 | def pytest_collection_modifyitems(config, items): |
| 33 | """Modify test collection to add markers automatically.""" |
nothing calls this directly
no outgoing calls
no test coverage detected