MCPcopy Create free account
hub / github.com/IBM/mcp-cli / mock_env

Function mock_env

tests/cli/test_main_coverage.py:96–117  ·  view source on GitHub ↗

Set up common patches that are needed for most tests.

()

Source from the content-addressed store, hash-verified

94
95@pytest.fixture
96def mock_env():
97 """Set up common patches that are needed for most tests."""
98 patches = {}
99
100 # Patch run_command_sync to be a no-op
101 patches["run_command_sync"] = patch(
102 "mcp_cli.main.run_command_sync", return_value=None
103 )
104 # Patch process_options to return fake data
105 patches["process_options"] = patch(
106 "mcp_cli.main.process_options",
107 return_value=_make_process_options_return(),
108 )
109
110 mocks = {}
111 for name, p in patches.items():
112 mocks[name] = p.start()
113
114 yield mocks
115
116 for p in patches.values():
117 p.stop()
118
119
120# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

startMethod · 0.80
stopMethod · 0.80

Tested by

no test coverage detected