Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests with Python 3.12 #261

Open
fabaff opened this issue Feb 28, 2024 · 0 comments · May be fixed by #262
Open

Failing tests with Python 3.12 #261

fabaff opened this issue Feb 28, 2024 · 0 comments · May be fixed by #262

Comments

@fabaff
Copy link

fabaff commented Feb 28, 2024

Some tests are failing with Python 3.12 while they are passing with Python 3.11.

============================= test session starts ==============================
platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.4.0
rootdir: /build/source
configfile: setup.cfg
plugins: aiohttp-1.0.5, asyncio-0.21.1
asyncio: mode=Mode.STRICT
collected 210 items / 8 deselected / 202 selected                              

tests/test_auth.py F..FFF.                                               [  3%]
tests/test_client.py ...........                                         [  8%]
tests/test_exceptions.py ..                                              [  9%]
tests/test_paging.py .....                                               [ 12%]
tests/test_pipeline.py .....                                             [ 14%]
tests/test_polling.py ....                                               [ 16%]
tests/test_requests_universal.py ....                                    [ 18%]
tests/test_runtime.py ...............                                    [ 26%]
tests/test_serialization.py ............................................ [ 48%]
.......................................                                  [ 67%]
tests/test_universal_pipeline.py ...                                     [ 68%]
tests/test_xml_serialization.py ........................................ [ 88%]
...........                                                              [ 94%]
tests/asynctests/test_async_client.py ..                                 [ 95%]
tests/asynctests/test_async_paging.py .....                              [ 97%]
tests/asynctests/test_pipeline.py .                                      [ 98%]
tests/asynctests/test_polling.py ....                                    [100%]

=================================== FAILURES ===================================
_____________________ TestAuthentication.test_apikey_auth ______________________

self = <tests.test_auth.TestAuthentication testMethod=test_apikey_auth>

    def test_apikey_auth(self):
        auth = ApiKeyCredentials(
            in_headers={
                'testheader' : 'testheadervalue'
            }
        )
        session = auth.signed_session()
        prep_req = session.prepare_request(self.request)
>       self.assertDictContainsSubset({'testheader' : 'testheadervalue'}, prep_req.headers)
E       AttributeError: 'TestAuthentication' object has no attribute 'assertDictContainsSubset'

tests/test_auth.py:114: AttributeError
_______________________ TestAuthentication.test_cs_auth ________________________

self = <tests.test_auth.TestAuthentication testMethod=test_cs_auth>

    def test_cs_auth(self):
        auth = CognitiveServicesCredentials("mysubkey")
        session = auth.signed_session()
        prep_req = session.prepare_request(self.request)
>       self.assertDictContainsSubset({'Ocp-Apim-Subscription-Key' : 'mysubkey'}, prep_req.headers)
E       AttributeError: 'TestAuthentication' object has no attribute 'assertDictContainsSubset'

tests/test_auth.py:129: AttributeError
____________________ TestAuthentication.test_eventgrid_auth ____________________

self = <tests.test_auth.TestAuthentication testMethod=test_eventgrid_auth>

    def test_eventgrid_auth(self):
        auth = TopicCredentials("mytopickey")
        session = auth.signed_session()
        prep_req = session.prepare_request(self.request)
>       self.assertDictContainsSubset({'aeg-sas-key' : 'mytopickey'}, prep_req.headers)
E       AttributeError: 'TestAuthentication' object has no attribute 'assertDictContainsSubset'

tests/test_auth.py:135: AttributeError
________________ TestAuthentication.test_eventgrid_domain_auth _________________

self = <tests.test_auth.TestAuthentication testMethod=test_eventgrid_domain_auth>

    def test_eventgrid_domain_auth(self):
        auth = DomainCredentials("mydomainkey")
        session = auth.signed_session()
        prep_req = session.prepare_request(self.request)
>       self.assertDictContainsSubset({'aeg-sas-key' : 'mydomainkey'}, prep_req.headers)
E       AttributeError: 'TestAuthentication' object has no attribute 'assertDictContainsSubset'

tests/test_auth.py:141: AttributeError
=============================== warnings summary ===============================
tests/test_client.py::TestServiceClient::test_client_request
tests/test_client.py::TestServiceClient::test_deprecated_creds
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_3_times
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_404
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_408
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_501
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_502
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_505
tests/test_runtime.py::TestRuntimeRetry::test_request_retry_max
  /build/source/msrest/service_client.py:259: DeprecationWarning: Creds parameter is deprecated. Set config.credentials instead.
    warnings.warn("Creds parameter is deprecated. Set config.credentials instead.",

tests/test_runtime.py: 31 warnings
  /nix/store/aqx5gpnblac0dz6dajvv2aj4hxlxpixq-python3.12-httpretty-1.1.4/lib/python3.12/site-packages/httpretty/core.py:1077: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================= slowest 10 durations =============================
2.00s call     tests/asynctests/test_polling.py::test_poller
1.00s call     tests/test_polling.py::test_poller
0.04s call     tests/test_client.py::TestServiceClient::test_client_send
0.04s call     tests/test_client.py::TestServiceClient::test_deprecated_creds
0.03s call     tests/asynctests/test_async_client.py::TestServiceClient::test_client_send
0.03s call     tests/test_client.py::TestServiceClient::test_format_url
0.02s call     tests/test_client.py::TestServiceClient::test_client_request
0.02s call     tests/test_client.py::TestServiceClient::test_keep_alive
0.02s call     tests/test_client.py::TestServiceClient::test_context_manager
0.02s call     tests/test_client.py::TestServiceClient::test_sdk_context_manager
=========================== short test summary info ============================
FAILED tests/test_auth.py::TestAuthentication::test_apikey_auth - AttributeError: 'TestAuthentication' object has no attribute 'assertDictCon...
FAILED tests/test_auth.py::TestAuthentication::test_cs_auth - AttributeError: 'TestAuthentication' object has no attribute 'assertDictCon...
FAILED tests/test_auth.py::TestAuthentication::test_eventgrid_auth - AttributeError: 'TestAuthentication' object has no attribute 'assertDictCon...
FAILED tests/test_auth.py::TestAuthentication::test_eventgrid_domain_auth - AttributeError: 'TestAuthentication' object has no attribute 'assertDictCon...
=========== 4 failed, 198 passed, 8 deselected, 40 warnings in 4.33s ===========
@adamchainz adamchainz linked a pull request Jul 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant