Set up common patches that are needed for most tests.
()
| 94 | |
| 95 | @pytest.fixture |
| 96 | def 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 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected