Toot
Written by Pamela Fox on 2024-12-06 at 23:02
I had a lot of tricky tests to write today that needed mocks against an async SDK.
To get started, I tried out GitHub Copilot "generate tests".
Observations:
- Copilot really liked using MagicMock, whereas I generally construct the actual class and use monkeypatch.setattr to mock the methods used.
- Copilot's tests did often pass, after a few tweaks.
- When a test didn't pass, I found it harder to debug MagicMock mocks, because they mocked too much- I wasn't getting errors for undefined attrs.
=> More informations about this toot | View the thread | More toots from pamelafox@fosstodon.org
Mentions
Tags
Proxy Information
- Original URL
- gemini://mastogem.picasoft.net/toot/113608371139699256
- Status Code
- Success (20)
- Meta
text/gemini
- Capsule Response Time
- 248.335181 milliseconds
- Gemini-to-HTML Time
- 0.58764 milliseconds
This content has been proxied by September (3851b).