lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.07k stars 120 forks source link

Replace status-only network calls in tests with HTTP mocks #149

Closed lukasschwab closed 11 months ago

lukasschwab commented 11 months ago

Motivation

A clear and concise description of what the problem is. For example, "I'm always frustrated when..."

teapot.fly.dev is a service I wrote and host — it reimplements the httpstat.us API (mirrors requested HTTP statuses).

It's best to avoid making real network requests in integration tests, especially for services besides the arXiv API (arguably unavoidable):

Solution

A clear and concise description of what you want to happen.

get_code_client should return a client that mocks HTTP responses. I assume there are good solutions for mocking requests.

Considered alternatives

A clear and concise description of any alternative solutions or features you've considered.

148 replaces httpstat.us; it had all the disadvantages of teapot.fly.dev, with two additional downsides:

Additional context

Add any other context about the feature request here.

None