Skip to content

Use respx in unit tests #1814

@freddyaboulton

Description

@freddyaboulton

In #1794, we use MagicMock to mock out http requests, we should consider using the industry standard aioresponses library

Sounds good! actually there is a similar library for this which I like, it mocks the request call and you don't mock your code at all. I would suggest we use it, but @freddyaboulton's approach works as well!

The library is aioresponses and there is a pytest plugin .

Originally posted by @farukozderim in #1794 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorInvolves refactoring existing codetestingRelated to testing and CI

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions