Repository: psf/cachecontrol (language: python)

Issue:
0.12.12: pytest is failing in `tests/test_etag.py::TestReleaseConnection::test_not_modified_releases_connection` unit
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
- `python3 -sBm build -w --no-isolation`
- because I'm calling `build` with `--no-isolation` I'm using during all processes only locally installed modules
- install .whl file in </install/prefix> using 'installer` module
- run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
- build is performed in env which is *`cut off from access to the public network`* (pytest is executed with `-m "not network"`)

Here is pytest output:
<details>

```console
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cachecontrol-0.12.12-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cachecontrol-0.12.12-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cachecontrol-0.12.12
configfile: setup.cfg
collected 97 items

tests/test_adapter.py ...........                                                                                                                                                     [ 11%]
tests/test_cache_control.py .......................                                                                                                                                   [ 35%]
tests/test_chunked_response.py ...                                                                                                                                                    [ 38%]
tests/test_etag.py ..F                                                                                                                                                                [ 41%]
tests/test_expires_heuristics.py ................                                                                                                                                     [ 57%]
tests/test_max_age.py ..                                                                                                                                                              [ 59%]
tests/test_redirects.py ....                                                                                                                                                          [ 63%]
tests/test_regressions.py ..                                                                                                                                                          [ 65%]
tests/test_serialization.py ...........                                                                                                                                               [ 77%]
tests/test_server_http_version.py .                                                                                                                                                   [ 78%]
tests/test_storage_filecache.py ..................                                                                                                                                    [ 96%]
tests/test_storage_redis.py ..                                                                                                                                                        [ 98%]
tests/test_vary.py .                                                                                                                                                                  [100%]

========================================================================================= FAILURES ==========================================================================================
________________________________________________________________ TestReleaseConnection.test_not_modified_releases_connection ________________________________________________________________

self = <tests.test_etag.TestReleaseConnection object at 0x7fe158571bb0>, server = <cherrypy._cpserver.Server object at 0x7fe161206640>, url = 'http://127.0.0.1:60573/'

    def test_not_modified_releases_connection(self, server, url):
        sess = CacheControl(requests.Session())
        etag_url = urljoin(url, "/etag")
        sess.get(etag_url)

        resp = Mock(status=304, headers={})

        # This is how the urllib3 response is created in
        # requests.adapters
        response_mod = "requests.adapters.HTTPResponse.from_httplib"

>       with patch(response_mod, Mock(return_value=resp)):

tests/test_etag.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/mock/mock.py:1398: in __enter__
    self.target = self.getter()
/usr/lib/python3.8/site-packages/mock/mock.py:1573: in <lambda>
    getter = lambda: _importer(target)
/usr/lib/python3.8/site-packages/mock/mock.py:1249: in _importer
    thing = _dot_lookup(thing, comp, import_path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

thing = <module 'requests.adapters' from '/usr/lib/python3.8/site-packages/requests/adapters.py'>, comp = 'HTTPResponse', import_path = 'requests.adapters.HTTPResponse'

    def _dot_lookup(thing, comp, import_path):
        try:
            return getattr(thing, comp)
        except AttributeError:
>           __import__(import_path)
E           ModuleNotFoundError: No module named 'requests.adapters.HTTPResponse'; 'requests.adapters' is not a package

/usr/lib/python3.8/site-packages/mock/mock.py:1238: ModuleNotFoundError
===================================================================================== warnings summary ======================================================================================
tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_headers
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_headers is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_cache
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_cache is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_pragma_no_cache
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_pragma_no_cache is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_store
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_no_store is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_max_age_0
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_max_age_0 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_not_in_cache
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_not_in_cache is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_fresh_max_age
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_fresh_max_age is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_unfresh_max_age
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_unfresh_max_age is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_fresh_expires
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_fresh_expires is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_unfresh_expires
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cache_request_unfresh_expires is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_cache_control.py::TestCacheControlRequest::test_cached_request_with_bad_max_age_headers_not_returned
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_cache_control.py::TestCacheControlRequest::test_cached_request_with_bad_max_age_headers_not_returned is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestHeuristicWithoutWarning::test_no_header_change_means_no_warning_header
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestHeuristicWithoutWarning::test_no_header_change_means_no_warning_header is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestHeuristicWith3xxResponse::test_heuristic_applies_to_301
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestHeuristicWith3xxResponse::test_heuristic_applies_to_301 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestHeuristicWith3xxResponse::test_heuristic_applies_to_304
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestHeuristicWith3xxResponse::test_heuristic_applies_to_304 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestOneDayCache::test_cache_for_one_day
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestOneDayCache::test_cache_for_one_day is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestExpiresAfter::test_expires_after_one_day
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestExpiresAfter::test_expires_after_one_day is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestLastModified::test_last_modified
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestLastModified::test_last_modified is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_no_expiry_is_inferred_when_no_last_modified_is_present
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_no_expiry_is_inferred_when_no_last_modified_is_present is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_expires_is_not_replaced_when_present
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_expires_is_not_replaced_when_present is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_used
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_used is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_not_used_when_cache_control_present
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_not_used_when_cache_control_present is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_not_used_when_status_is_unknown
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_not_used_when_status_is_unknown is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_used_when_cache_control_public
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_last_modified_is_used_when_cache_control_public is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_warning_not_added_when_response_more_recent_than_24_hours
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_warning_not_added_when_response_more_recent_than_24_hours is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_warning_is_not_added_when_heuristic_was_not_used
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_warning_is_not_added_when_heuristic_was_not_used is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_expires_heuristics.py::TestModifiedUnitTests::test_expiry_is_no_more_that_twenty_four_hours
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_expires_heuristics.py::TestModifiedUnitTests::test_expiry_is_no_more_that_twenty_four_hours is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_redirects.py::TestPermanentRedirects::test_redirect_response_is_cached
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_redirects.py::TestPermanentRedirects::test_redirect_response_is_cached is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_redirects.py::TestPermanentRedirects::test_bust_cache_on_redirect
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_redirects.py::TestPermanentRedirects::test_bust_cache_on_redirect is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_redirects.py::TestMultipleChoicesRedirects::test_multiple_choices_is_cacheable
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_redirects.py::TestMultipleChoicesRedirects::test_multiple_choices_is_cacheable is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_redirects.py::TestMultipleChoicesRedirects::test_bust_cache_on_redirect
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_redirects.py::TestMultipleChoicesRedirects::test_bust_cache_on_redirect is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_load_by_version_v0
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_load_by_version_v0 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_version_v1
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_version_v1 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_version_v2
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_version_v2 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_load_by_version_v3
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_load_by_version_v3 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_version_v4
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_version_v4 is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_v1_serialized_with_py2_TypeError
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_v1_serialized_with_py2_TypeError is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_v2_corrupted_cache
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_v2_corrupted_cache is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_latest_version_streamable
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_latest_version_streamable is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_read_latest_version
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_read_latest_version is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_no_vary_header
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_no_vary_header is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_serialization.py::TestSerializer::test_no_body_creates_response_file_handle_on_dumps
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_serialization.py::TestSerializer::test_no_body_creates_response_file_handle_on_dumps is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_storage_redis.py::TestRedisCache::test_set_expiration_datetime
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_storage_redis.py::TestRedisCache::test_set_expiration_datetime is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

tests/test_storage_redis.py::TestRedisCache::test_set_expiration_int
  /usr/lib/python3.8/site-packages/_pytest/fixtures.py:902: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_storage_redis.py::TestRedisCache::test_set_expiration_int is using nose-specific method: `setup(self)`
  To remove this warning, rename it to `setup_method(self)`
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
FAILED tests/test_etag.py::TestReleaseConnection::test_not_modified_releases_connection - ModuleNotFoundError: No module named 'requests.adapters.HTTPResponse'; 'requests.adapters' is not a package
========================================================================= 1 failed, 96 passed, 43 warnings in 0.89s =========================================================================
```
</details>

Here is list of installed modules in build env
<details>

```console
Package                       Version
----------------------------- ---------
alabaster                     0.7.13
asttokens                     2.2.1
async-timeout                 4.0.2
autocommand                   2.2.1
Babel                         2.12.1
backcall                      0.2.0
build                         0.10.0
charset-normalizer            3.1.0
cheroot                       9.0.0
CherryPy                      18.8.0
decorator                     5.1.1
distro                        1.8.0
docutils                      0.19
exceptiongroup                1.1.1
executing                     1.2.0
filelock                      3.12.0
gpg                           1.20.0
idna                          3.4
imagesize                     1.4.1
importlib-metadata            6.6.0
importlib-resources           5.12.0
inflect                       6.0.4
iniconfig                     2.0.0
installer                     0.7.0
ipython                       8.12.0
jaraco.collections            4.1.0
jaraco.context                4.3.0
jaraco.functools              3.6.0
jaraco.text                   3.11.1
jedi                          0.18.2
Jinja2                        3.1.2
libcomps                      0.1.19
MarkupSafe                    2.1.2
matplotlib-inline             0.1.6
mock                          4.0.3
more-itertools                9.1.0
msgpack                       1.0.5
packaging                     23.1
parso                         0.8.3
pexpect                       4.8.0
pickleshare                   0.7.5
pluggy                        1.0.0
portend                       3.1.0
prompt-toolkit                3.0.38
ptyprocess                    0.7.0
pure-eval                     0.2.2
pydantic                      1.10.7
Pygments                      2.15.1
pyproject_hooks               1.0.0
pytest                        7.3.1
python-dateutil               2.8.2
pytz                          2023.2
redis                         4.5.5
requests                      2.30.0
setuptools                    67.7.2
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        6.2.1
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.6.2
tempora                       5.2.2
tomli                         2.0.1
traitlets                     5.9.0
typing_extensions             4.5.0
urllib3                       1.26.15
wcwidth                       0.2.6
wheel                         0.40.0
zc.lockfile                   3.0.post1
zipp                          3.15.0
```
</details>



Discussion / hints:
Maybe duplicate with #297
Yep .. loks like thet.
I would keep that ticket opened becuse here are reported pytest warnings as well.

Fix patch:
diff --git a/README.rst b/README.rst
index 7e6223f..37f70db 100644
--- a/README.rst
+++ b/README.rst
@@ -11,8 +11,8 @@
     :target: https://pypi.python.org/pypi/cachecontrol
     :alt: Latest Version
 
-.. image:: https://travis-ci.org/ionrock/cachecontrol.png?branch=master
-  :target: https://travis-ci.org/ionrock/cachecontrol
+.. image:: https://github.com/psf/cachecontrol/actions/workflows/tests.yml/badge.svg
+  :target: https://github.com/psf/cachecontrol/actions/workflows/tests.yml
 
 CacheControl is a port of the caching algorithms in httplib2_ for use with
 requests_ session object.


Test patch:
diff --git a/tests/test_cache_control.py b/tests/test_cache_control.py
index 53c2f00..bb9afbd 100644
--- a/tests/test_cache_control.py
+++ b/tests/test_cache_control.py
@@ -5,18 +5,19 @@
 """
 Unit tests that verify our caching methods work correctly.
 """
-import pytest
-from unittest.mock import ANY, Mock
 import time
 from tempfile import mkdtemp
+from unittest.mock import ANY, Mock
+
+import pytest
 
 from cachecontrol import CacheController
 from cachecontrol.cache import DictCache
 from cachecontrol.caches import SeparateBodyFileCache
-from .utils import NullSerializer, DummyResponse, DummyRequest
 
-TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
+from .utils import DummyRequest, DummyResponse, NullSerializer
 
+TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
 
 
 class TestCacheControllerResponse(object):
@@ -126,13 +127,16 @@ def test_update_cached_response_no_local_cache(self):
         cache = DictCache({})
         cc = CacheController(cache)
         req = DummyRequest(url="http://localhost/", headers={"if-match": "xyz"})
-        resp = DummyResponse(status=304, headers={
-            "ETag": "xyz",
-            "x-value": "b",
-            "Date": time.strftime(TIME_FMT, time.gmtime()),
-            "Cache-Control": "max-age=60",
-            "Content-Length": "200"
-        })
+        resp = DummyResponse(
+            status=304,
+            headers={
+                "ETag": "xyz",
+                "x-value": "b",
+                "Date": time.strftime(TIME_FMT, time.gmtime()),
+                "Cache-Control": "max-age=60",
+                "Content-Length": "200",
+            },
+        )
         # First, ensure the response from update_cached_response() matches the
         # cached one:
         result = cc.update_cached_response(req, resp)
@@ -176,13 +180,16 @@ def update_cached_response_with_valid_headers_test(self, cache):
         cc = CacheController(cache)
         url = "http://localhost:123/x"
         req = DummyRequest(url=url, headers={})
-        cached_resp = DummyResponse(status=200, headers={
-            "ETag": etag,
-            "x-value:": "a",
-            "Content-Length": "100",
-            "Cache-Control": "max-age=60",
-            "Date": time.strftime(TIME_FMT, time.gmtime()),
-        })
+        cached_resp = DummyResponse(
+            status=200,
+            headers={
+                "ETag": etag,
+                "x-value:": "a",
+                "Content-Length": "100",
+                "Cache-Control": "max-age=60",
+                "Date": time.strftime(TIME_FMT, time.gmtime()),
+            },
+        )
         cc._cache_set(url, req, cached_resp, b"my body")
 
         # Now we get another request, and it's a 304, with new value for
@@ -191,13 +198,16 @@ def update_cached_response_with_valid_headers_test(self, cache):
         # Set our content length to 200. That would be a mistake in
         # the server, but we'll handle it gracefully... for now.
         req = DummyRequest(url=url, headers={"if-match": etag})
-        resp = DummyResponse(status=304, headers={
-            "ETag": etag,
-            "x-value": "b",
-            "Date": time.strftime(TIME_FMT, time.gmtime()),
-            "Cache-Control": "max-age=60",
-            "Content-Length": "200"
-        })
+        resp = DummyResponse(
+            status=304,
+            headers={
+                "ETag": etag,
+                "x-value": "b",
+                "Date": time.strftime(TIME_FMT, time.gmtime()),
+                "Cache-Control": "max-age=60",
+                "Content-Length": "200",
+            },
+        )
         # First, ensure the response from update_cached_response() matches the
         # cached one:
         result = cc.update_cached_response(req, resp)
@@ -214,7 +224,7 @@ def update_cached_response_with_valid_headers_test(self, cache):
 class TestCacheControlRequest(object):
     url = "http://foo.com/bar"
 
-    def setup(self):
+    def setup_method(self):
         self.c = CacheController(DictCache(), serializer=NullSerializer())
 
     def req(self, headers):
@@ -222,7 +232,9 @@ def req(self, headers):
         return self.c.cached_request(mock_request)
 
     def test_cache_request_no_headers(self):
-        cached_resp = Mock(headers={"ETag": "jfd9094r808", "Content-Length": 100}, status=200)
+        cached_resp = Mock(
+            headers={"ETag": "jfd9094r808", "Content-Length": 100}, status=200
+        )
         self.c.cache = DictCache({self.url: cached_resp})
         resp = self.req({})
         assert not resp
diff --git a/tests/test_expires_heuristics.py b/tests/test_expires_heuristics.py
index a946b2b..2dd1b5f 100644
--- a/tests/test_expires_heuristics.py
+++ b/tests/test_expires_heuristics.py
@@ -4,26 +4,27 @@
 
 import calendar
 import time
-
-from email.utils import formatdate, parsedate
 from datetime import datetime
-
+from email.utils import formatdate, parsedate
+from pprint import pprint
 from unittest.mock import Mock
+
 from requests import Session, get
 
 from cachecontrol import CacheControl
-from cachecontrol.heuristics import LastModified, ExpiresAfter, OneDayCache
-from cachecontrol.heuristics import TIME_FMT
-from cachecontrol.heuristics import BaseHeuristic
-from .utils import DummyResponse
+from cachecontrol.heuristics import (
+    TIME_FMT,
+    BaseHeuristic,
+    ExpiresAfter,
+    LastModified,
+    OneDayCache,
+)
 
-from pprint import pprint
+from .utils import DummyResponse
 
 
 class TestHeuristicWithoutWarning(object):
-
-    def setup(self):
-
+    def setup_method(self):
         class NoopHeuristic(BaseHeuristic):
             warning = Mock()
 
@@ -35,17 +36,14 @@ def update_headers(self, resp):
 
     def test_no_header_change_means_no_warning_header(self, url):
         the_url = url + "optional_cacheable_request"
-        resp = self.sess.get(the_url)
+        self.sess.get(the_url)
 
         assert not self.heuristic.warning.called
 
 
 class TestHeuristicWith3xxResponse(object):
-
-    def setup(self):
-
+    def setup_method(self):
         class DummyHeuristic(BaseHeuristic):
-
             def update_headers(self, resp):
                 return {"x-dummy-header": "foobar"}
 
@@ -63,7 +61,6 @@ def test_heuristic_applies_to_304(self, url):
 
 
 class TestUseExpiresHeuristic(object):
-
     def test_expires_heuristic_arg(self):
         sess = Session()
         cached_sess = CacheControl(sess, heuristic=Mock())
@@ -71,8 +68,7 @@ def test_expires_heuristic_arg(self):
 
 
 class TestOneDayCache(object):
-
-    def setup(self):
+    def setup_method(self):
         self.sess = Session()
         self.cached_sess = CacheControl(self.sess, heuristic=OneDayCache())
 
@@ -91,8 +87,7 @@ def test_cache_for_one_day(self, url):
 
 
 class TestExpiresAfter(object):
-
-    def setup(self):
+    def setup_method(self):
         self.sess = Session()
         self.cache_sess = CacheControl(self.sess, heuristic=ExpiresAfter(days=1))
 
@@ -112,8 +107,7 @@ def test_expires_after_one_day(self, url):
 
 
 class TestLastModified(object):
-
-    def setup(self):
+    def setup_method(self):
         self.sess = Session()
         self.cached_sess = CacheControl(self.sess, heuristic=LastModified())
 
@@ -136,11 +130,10 @@ def datetime_to_header(dt):
 
 
 class TestModifiedUnitTests(object):
-
     def last_modified(self, period):
         return time.strftime(TIME_FMT, time.gmtime(self.time_now - period))
 
-    def setup(self):
+    def setup_method(self):
         self.heuristic = LastModified()
         self.time_now = time.time()
         day_in_seconds = 86400
diff --git a/tests/test_redirects.py b/tests/test_redirects.py
index 56571f6..af9723f 100644
--- a/tests/test_redirects.py
+++ b/tests/test_redirects.py
@@ -11,8 +11,7 @@
 
 
 class TestPermanentRedirects(object):
-
-    def setup(self):
+    def setup_method(self):
         self.sess = CacheControl(requests.Session())
 
     def test_redirect_response_is_cached(self, url):
@@ -33,8 +32,7 @@ def test_bust_cache_on_redirect(self, url):
 
 
 class TestMultipleChoicesRedirects(object):
-
-    def setup(self):
+    def setup_method(self):
         self.sess = CacheControl(requests.Session())
 
     def test_multiple_choices_is_cacheable(self, url):
diff --git a/tests/test_serialization.py b/tests/test_serialization.py
index 85aad7d..b22b249 100644
--- a/tests/test_serialization.py
+++ b/tests/test_serialization.py
@@ -12,7 +12,7 @@
 
 
 class TestSerializer(object):
-    def setup(self):
+    def setup_method(self):
         self.serializer = Serializer()
         self.response_data = {
             "response": {
diff --git a/tests/test_storage_redis.py b/tests/test_storage_redis.py
index d0e9a67..6d6f07c 100644
--- a/tests/test_storage_redis.py
+++ b/tests/test_storage_redis.py
@@ -3,14 +3,13 @@
 # SPDX-License-Identifier: Apache-2.0
 
 from datetime import datetime
-
 from unittest.mock import Mock
+
 from cachecontrol.caches import RedisCache
 
 
 class TestRedisCache(object):
-
-    def setup(self):
+    def setup_method(self):
         self.conn = Mock()
         self.cache = RedisCache(self.conn)
 
diff --git a/tests/utils.py b/tests/utils.py
index 8453006..99e67ec 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -4,8 +4,10 @@
 
 from requests.structures import CaseInsensitiveDict
 
+from cachecontrol.serialize import Serializer
 
-class NullSerializer(object):
+
+class NullSerializer(Serializer):
 
     def dumps(self, request, response, body=None):
         return response