personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests: bypass worktree guard in port check unit tests

After 745ea06 and c2610f8d added the worktree-skip branch to port_5015_free_check, test_ok_when_port_free and test_fail_on_lsof_timeout can short-circuit before reaching the lsof probe path when the suite runs from a git worktree. Patch both tests to monkey-patch import_install_guard to raise ImportError so they exercise the bare except Exception: pass fall-through they were written to cover. No production code changes.

Co-authored-by: OpenAI Codex <codex@openai.com>

+10
+10
tests/test_doctor.py
··· 272 272 assert result.status == "skip" 273 273 274 274 def test_ok_when_port_free(self, doctor, monkeypatch): 275 + monkeypatch.setattr( 276 + doctor, 277 + "import_install_guard", 278 + lambda: (_ for _ in ()).throw(ImportError("skip worktree guard")), 279 + ) 275 280 monkeypatch.setattr(doctor.shutil, "which", lambda _name: "/usr/bin/lsof") 276 281 monkeypatch.setattr( 277 282 doctor, ··· 316 321 assert "/usr/bin/python3" in result.detail 317 322 318 323 def test_fail_on_lsof_timeout(self, doctor, monkeypatch): 324 + monkeypatch.setattr( 325 + doctor, 326 + "import_install_guard", 327 + lambda: (_ for _ in ()).throw(ImportError("skip worktree guard")), 328 + ) 319 329 monkeypatch.setattr(doctor.shutil, "which", lambda _name: "/usr/bin/lsof") 320 330 321 331 def raise_timeout(*_args, **_kwargs):