MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / httpbin_wrapper

Function httpbin_wrapper

tests/conftest.py:116–124  ·  view source on GitHub ↗

Allow pytest-httpbin to be used instead of the httpbin Docker container. This fixture does not need to be used manually. It will be autoused if both: * pytest-httpbin is installed * The environment variable USE_PYTEST_HTTPBIN is set to 'true'

(httpbin)

Source from the content-addressed store, hash-verified

114
115@pytest.fixture(scope='session', autouse=USE_PYTEST_HTTPBIN)
116def httpbin_wrapper(httpbin):
117 """Allow pytest-httpbin to be used instead of the httpbin Docker container. This fixture does
118 not need to be used manually. It will be autoused if both:
119 * pytest-httpbin is installed
120 * The environment variable USE_PYTEST_HTTPBIN is set to 'true'
121 """
122 logger.info('Using pytest-httpin for integration tests')
123 os.environ['HTTPBIN_URL'] = httpbin.url
124 return httpbin
125
126
127@pytest.fixture(scope='function')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…