Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Utility Extension for requests_mock: Multi-API Mocker #240

Open
jab3z opened this issue Nov 14, 2023 · 2 comments
Open

New Utility Extension for requests_mock: Multi-API Mocker #240

jab3z opened this issue Nov 14, 2023 · 2 comments

Comments

@jab3z
Copy link

jab3z commented Nov 14, 2023

Hello!

I've developed Multi-API Mocker, a utility enhancing requests_mock for easier mocking of multiple API calls in pytest. It aims to improve test readability and maintainability in complex API scenarios.

You can find it here.

Your work inspired its creation, and I hope it can be a valuable tool for the community. Any feedback or sharing would be greatly appreciated.

Best,
Dacian Popute
Ottu.com

@jamielennox
Copy link
Owner

That looks really cool and i hope it's going well! Just because of the projects i worked on i was always more familiar with unittest, i did the pytest extension and learnt a bit but always felt there was something a lot more that could be done there.

There's a contrib folder i had set up in requests-mock, but honestly I'd keep your own project as i'm always responsive on the issues (as seen by this delay) and it allows you to be way more opinionated about the design.

Let me know if there's anything that you need, or that could be tweaked to make it easier to consume, it should be fine but I didn't explicitly think about the subclass use case so i expect there are some private classes that you might need (for example).

@jab3z
Copy link
Author

jab3z commented Jan 24, 2024

It's going very well, already implemented it on our internal projects, and we're happy with it as we managed to drop the cassette implementation we had earlier.

Yes, subclasses are one of the backbone components of the package, especially for usability.

Maybe adding the package in requests_mocks documentation under a new section Extensions? Just saying. We mostly developed this package for our own, but others are welcomed to use it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants