pytest_httpx
pytest-sugar
pytest_httpx | pytest-sugar | |
---|---|---|
1 | 2 | |
308 | 1,250 | |
- | - | |
7.8 | 6.9 | |
6 days ago | 3 months ago | |
Python | Python | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pytest_httpx
-
Tips to prevent adoption of your API
I avoid writing automated tests that hit an external API - especially one out of my control - because I don't want my CI runs to ever fail because someone else's service wasn't responding. I want CI to be a completely closed box, such that any failures mean there's a bug in my code.
If I want to test external APIs I'll do that in a separate set of integration tests which are run as part of a separate system, not as part of my CI for every code commit to my repo.
I mostly use Python, and the APIs I talk to are mostly accessed via the requests or httpx libraries - both of which have excellent libraries for productive mocking:
- https://requests-mock.readthedocs.io/en/latest/pytest.html
- https://github.com/Colin-b/pytest_httpx
pytest-sugar
-
What if writing tests was a joyful experience?
Same here. I get lovely little dopamine hits from passing tests, enhanced by pytest-sugar [1] giving everything a little green check mark.
[1] https://github.com/Teemu/pytest-sugar
- That moment when you have been spoiled with great tools and standards for 6 years and then get thrown into the pits of "I don't see what's wrong with this"
What are some alternatives?
respx - Mock HTTPX with awesome request patterns and response side effects 🦋
nbval - A py.test plugin to validate Jupyter notebooks
hook-slinger - A generic service to send, retry, and manage webhooks
expecttest
httpx-cache - Simple caching transport for httpx
pytest-langchain - ✅ Pytest-style test runner for langchain projects
gomega - Ginkgo's Preferred Matcher Library
assert_value_elixir - ExUnit's assert on steroids that writes and updates tests for you
pytest-local - Simple forking server for testing with reusable context.
pytest-inline - pytest-inline is a pytest plugin for writing inline tests.
pytest-describe - Describe-style plugin for the pytest framework
pytest-patterns - pytest-patterns is a plugin for pytest that provides a pattern matching engine optimized for testing.