MCPcopy Create free account
hub / github.com/GH05TCREW/MetasploitMCP / pytest_collection_modifyitems

Function pytest_collection_modifyitems

conftest.py:32–49  ·  view source on GitHub ↗

Modify test collection to add markers automatically.

(config, items)

Source from the content-addressed store, hash-verified

30 sys.modules[module] = Mock()
31
32def pytest_collection_modifyitems(config, items):
33 """Modify test collection to add markers automatically."""
34 for item in items:
35 # Add unit marker to test_options_parsing and test_helpers
36 if "test_options_parsing" in item.nodeid or "test_helpers" in item.nodeid:
37 item.add_marker(pytest.mark.unit)
38
39 # Add integration marker to integration tests
40 if "test_tools_integration" in item.nodeid:
41 item.add_marker(pytest.mark.integration)
42
43 # Mark network tests
44 if "network" in item.name.lower():
45 item.add_marker(pytest.mark.network)
46
47 # Mark slow tests
48 if any(keyword in item.name.lower() for keyword in ["slow", "timeout", "long"]):
49 item.add_marker(pytest.mark.slow)
50
51@pytest.fixture(scope="session")
52def mock_msf_environment():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected