requests / toolbelt

A toolbelt of useful classes and functions to be used with python-requests
https://toolbelt.readthedocs.org
Other
1k stars 186 forks source link

Fix tests to be compatible with urllib3 2.0 #356

Open pquentin opened 1 year ago

pquentin commented 1 year ago

Somehow some cassette files were incompatible. I also tried adding urllib3 2.0 tests in CI, let's see how that goes.

pquentin commented 1 year ago

The urllib3 2.0 tests are fixed by https://github.com/urllib3/urllib3/pull/2998

sigmavirus24 commented 1 year ago

Is the company issue in the toolbelt or in betamax?

pquentin commented 1 year ago

What is the company issue sorry? If you mean https://github.com/urllib3/urllib3/issues/2999 it's a totally different issue

sigmavirus24 commented 1 year ago

*compatibility

If rerecording the cassettes makes a difference it makes me think the compatibility problem is in Betamax fundamentally

pquentin commented 1 year ago

Maybe it is. I don't know, I have to admit I stuck with the first thing that worked. But I did not have to change most responses, so this is definitely fishy. I would have to investigate more and understand how Betamax works.

kraj commented 1 year ago

patches from this pull are needed for tests to pass on master branch when using urllib3 2.0. I have a yocto setups and I can confirm the failures

==============================================================================================================
Failed test cases (sorted by testseries, ID)
==============================================================================================================
--------------------------------------------------------------------------------------------------------------
testseries | result_id : oeqa | runtime_meta-python-ptest-image-python3-requests-toolbelt_qemux86-64_20230713012809
    ptestresult.python3-requests-toolbelt.tests/test_dump.py::TestDumpRealResponses::test_dump_all
    ptestresult.python3-requests-toolbelt.tests/test_dump.py::TestDumpRealResponses::test_dump_response
    ptestresult.python3-requests-toolbelt.tests/test_sessions.py::TestBasedSession::test_prepared_request_override_base
    ptestresult.python3-requests-toolbelt.tests/test_sessions.py::TestBasedSession::test_prepared_request_with_base
    ptestresult.python3-requests-toolbelt.tests/test_sessions.py::TestBasedSession::test_request_override_base
    ptestresult.python3-requests-toolbelt.tests/test_sessions.py::TestBasedSession::test_request_with_base
--------------------------------------------------------------------------------------------------------------

without these patches.

pquentin commented 1 year ago

Thanks for confirming! However I'm not sure the approach is correct and still works on 1.26.x. We would have to fix our CI to tell.