Wave B-1 PR-B: missing-dep test coverage#34
Conversation
…ng (#9) Fakes the missing optional dependency via sys.modules + importlib.reload and verifies the constructor, send, and dispose all degrade gracefully — no exception, prompt return. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…issing (#9) Fakes the missing optional dependency via sys.modules + importlib.reload and verifies the stub class raises ImportError with the documented install hint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughTwo tests address missing optional dependencies: Flask extension raises an ChangesOptional dependency graceful degradation tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…dep-tests # Conflicts: # tests/test_transport.py
Summary
Closes #9 (the remaining two missing-dep tests not covered by PR-A #33).
test_local_transport_no_op_without_websockets— verifies_LocalTransportconstructs, sends, and disposes gracefully when the optionalwebsocketsdependency is absent.test_flask_extension_raises_clear_error_without_flask— verifies the stubRecostExtensionraisesImportErrorwith thepip install recost[flask]hint.Pattern
Both tests use
monkeypatch.setitem(sys.modules, "<name>", None)plusimportlib.reload(...)to fake the missing import, thenmonkeypatch.undo()+ reload-back infinallyto restore the real module so subsequent tests in the run aren't poisoned. Isolated as PR-B because the test shape differs meaningfully from everything in PR-A (#33).Test plan
pytest tests/test_transport.py -qclean (verifies no poisoning of TestLocalTransportSync / TestLocalTransportAsync / TestDisposeDuringConnect).pytest tests/test_flask.py -qclean (verifies no poisoning of TestRecostExtension).🤖 Generated with Claude Code
Summary by CodeRabbit