pytest-httpbin icon indicating copy to clipboard operation
pytest-httpbin copied to clipboard

JSON endpoint returns 404

Open JWCook opened this issue 3 years ago • 2 comments

It looks like /json currently returns a 404 with pytest-httpbin, while it returns a 200 with httpbin.org. All other response formats return a 200 with both pytest-httpbin and httpbin.org.

Minimal example:

import requests

def test_json(httpbin):
    assert requests.get('https://httpbin.org/json').status_code == 200
    assert requests.get(f'{httpbin.url}/json').status_code == 200
  • pytest-httpbin version: 1.0.0
  • python version: 3.8.5

JWCook avatar Apr 12 '21 17:04 JWCook

I skimmed over the pytest-httpbin code and couldn't see anything obvious that would be responsible for the /json endpoint being any different than the others, so for all I know this could be a quirk in the httpbin package and not necessarily specific to pytest-httpbin. I figured it would be worth making an issue anyway, in case anyone else knows what's going on there.

JWCook avatar Apr 12 '21 18:04 JWCook

@JWCook can you make a PR with a test for this in?

graingert avatar May 11 '23 13:05 graingert