respx icon indicating copy to clipboard operation
respx copied to clipboard

Add router context manager utility for asserting call count

Open lundberg opened this issue 2 years ago • 0 comments

e.g.

@respx.mock
def test_called():
    respx.get("https://example.com/foobar", name="foobar")
    respx.get("https://example.com/hamspam", name="hamspam")

    with respx.assert_call_count(foobar=1, hamspam=0):
        httpx.get("https://example.com/foobar")

lundberg avatar Nov 30 '23 09:11 lundberg