Skip to content

recursive dependency involving fixture 'httpbin' detected when running tests #7016

@hramrach

Description

@hramrach

recursive dependency involving fixture 'httpbin' detected when running tests

Expected Result

tests run or provide actionable error report

Actual Result

Large part of tests failing to run because of 'recursive dependency'

Reproduction Steps

make ci

______________________________________________________________________________________ ERROR at setup of test_content_length_for_string_data_counts_bytes _______________________________________________________________________________________
file /home/hramrach/requests/tests/test_requests.py, line 3032
  @pytest.mark.skipif(
      is_urllib3_1,
      reason="urllib3 2.x encodes all strings to utf-8, urllib3 1.x uses latin-1",
  )
  def test_content_length_for_string_data_counts_bytes(httpbin):
file /home/hramrach/requests/tests/conftest.py, line 25
  @pytest.fixture
  def httpbin(httpbin):
E       recursive dependency involving fixture 'httpbin' detected
>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, httpbin, httpbin_secure, monkeypatch, nosan_server, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

Probably httpbin is missing and because of the way httpbin is used in the test code this cryptic message is produced.

System Information

$ python3 -m requests.help
{
  "chardet": {
    "version": "5.2.0"
  },
  "charset_normalizer": {
    "version": "3.4.2"
  },
  "cryptography": {
    "version": "44.0.3"
  },
  "idna": {
    "version": "3.10"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.13.5"
  },
  "platform": {
    "release": "6.12.0-160000.19-rt",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "30500000",
    "version": "25.0.0"
  },
  "requests": {
    "version": "2.32.4"
  },
  "system_ssl": {
    "version": "30500000"
  },
  "urllib3": {
    "version": "2.5.0"
  },
  "using_charset_normalizer": false,
  "using_pyopenssl": true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions