How do you write tests with pytest? Tell me about fixtures and how to replace an external dependency in a test.
~4 min by voice
How to approach it
This checks whether the candidate has written real pytest tests: whether they know the basic syntax, understand how fixtures work (injection via parameters, yield, scope, conftest.py), and can isolate a test from external services with mock/monkeypatch while understanding why.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.