Skip to content

Conversation

@JP-Ellis
Copy link
Contributor

📝 Summary

There are a number of tests which can be flaky due to internal connections.

🚨 Breaking Changes

🔥 Motivation

Ideally, the tests shouldn't be flaky, and while some improvements have been made to have tests less flaky, they still can be flaky (especially on Linux for some reason).

🔨 Test Plan

Time will tell.

🔗 Related issues/PRs

There are a number of tests which can be flaky due to internal
connections.

Signed-off-by: JP-Ellis <josh@jpellis.me>
@JP-Ellis JP-Ellis self-assigned this Nov 28, 2025
Copilot AI review requested due to automatic review settings November 28, 2025 03:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automatic test rerun functionality to handle flaky tests caused by internal connection issues. The configuration retries failing tests up to 5 times, excluding assertion errors from reruns.

Changes

  • Configures pytest to automatically rerun flaky tests with specific exception handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Nov 28, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
588 1 587 14
View the top 3 failed test(s) by shortest run time
tests.test_pact::test_server_log
Stack Traces | 0.001s run time
pact = <Pact: consumer='consumer', provider='provider', handle=PactHandle(32725)>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_server_log#x1B[39;49;00m(pact: Pact) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>       #x1B[94mwith#x1B[39;49;00m pact.serve() #x1B[94mas#x1B[39;49;00m srv:#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31mtests/test_pact.py#x1B[0m:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31msrc/pact/pact.py#x1B[0m:773: in __enter__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._handle = pact_ffi.create_mock_server_for_transport(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pact = PactHandle(32725), addr = 'localhost', port = 60769, transport = 'http'
transport_config = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcreate_mock_server_for_transport#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        pact: PactHandle,#x1B[90m#x1B[39;49;00m
        addr: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        port: #x1B[96mint#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        transport: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        transport_config: #x1B[96mstr#x1B[39;49;00m | #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> PactServerHandle:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""#x1B[39;49;00m
    #x1B[33m    Create a mock server for the provided Pact handle and transport.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    [Rust#x1B[39;49;00m
    #x1B[33m    `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.4.28/pact_ffi/?search=pactffi_create_mock_server_for_transport)#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        pact:#x1B[39;49;00m
    #x1B[33m            Handle to the Pact model.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        addr:#x1B[39;49;00m
    #x1B[33m            The address to bind to.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        port:#x1B[39;49;00m
    #x1B[33m            The port number to bind to. A value of zero will result in the#x1B[39;49;00m
    #x1B[33m            operating system allocating an available port.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        transport:#x1B[39;49;00m
    #x1B[33m            The transport to use (i.e. http, https, grpc). The underlying Pact#x1B[39;49;00m
    #x1B[33m            library will interpret this, typically in a case-sensitive way.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        transport_config:#x1B[39;49;00m
    #x1B[33m            Configuration to be passed to the transport. This must be a valid#x1B[39;49;00m
    #x1B[33m            JSON string, or `None` if not required.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        A handle to the mock server.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        RuntimeError:#x1B[39;49;00m
    #x1B[33m            If the mock server could not be created. The error message will#x1B[39;49;00m
    #x1B[33m            contain details of the error.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ret: #x1B[96mint#x1B[39;49;00m = lib.pactffi_create_mock_server_for_transport(#x1B[90m#x1B[39;49;00m
            pact._ref,#x1B[90m#x1B[39;49;00m
            addr.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            port,#x1B[90m#x1B[39;49;00m
            transport.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (transport_config.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[94mif#x1B[39;49;00m transport_config #x1B[94melse#x1B[39;49;00m ffi.NULL),#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m ret > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m PactServerHandle(ret)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m ret == -#x1B[94m1#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAn invalid Pact handle was received: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m2#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mInvalid transport_config JSON.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m3#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mPact mock server could not be started for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m4#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mPanick during Pact mock server creation for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m5#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAddress is invalid: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00maddr#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAn unknown error occurred during Pact mock server creation for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mRuntimeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       RuntimeError: Pact mock server could not be started for PactHandle(32725).#x1B[0m

#x1B[1m#x1B[.../src/pact_ffi/__init__.py#x1B[0m:5035: RuntimeError
tests.compatibility_suite.test_v1_consumer::test_request_with_invalid_body
Stack Traces | 0.007s run time
fixturefunc = <function the_mock_server_is_started_with_interactions.<locals>._ at 0x7f2ee7567370>
request = <FixtureRequest for <Function test_request_with_invalid_body>>
kwargs = {'ids': [4], 'interaction_definitions': {1: <Body: type='HTTP', id=1, description=None, states=[], metadata=None, pend...one, response_headers=<MultiDict()>, response_body=None, response_matching_rules=None, response_generators=None>, ...}}

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcall_fixture_func#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        fixturefunc: _FixtureFunc[FixtureValue], request: FixtureRequest, kwargs#x1B[90m#x1B[39;49;00m
    ) -> FixtureValue:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m inspect.isgeneratorfunction(fixturefunc):#x1B[90m#x1B[39;49;00m
            fixturefunc = cast(Callable[..., Generator[FixtureValue]], fixturefunc)#x1B[90m#x1B[39;49;00m
            generator = fixturefunc(**kwargs)#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
>               fixture_result = #x1B[96mnext#x1B[39;49;00m(generator)#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m..../test/lib/python3.10.../site-packages/_pytest/fixtures.py#x1B[0m:908: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../compatibility_suite/util/consumer.py#x1B[0m:169: in _
    #x1B[0m#x1B[94mwith#x1B[39;49;00m pact.serve(raises=#x1B[94mFalse#x1B[39;49;00m) #x1B[94mas#x1B[39;49;00m srv:#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31msrc/pact/pact.py#x1B[0m:773: in __enter__
    #x1B[0m#x1B[96mself#x1B[39;49;00m._handle = pact_ffi.create_mock_server_for_transport(#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

pact = PactHandle(56207), addr = 'localhost', port = 39879, transport = 'http'
transport_config = None

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcreate_mock_server_for_transport#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        pact: PactHandle,#x1B[90m#x1B[39;49;00m
        addr: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        port: #x1B[96mint#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        transport: #x1B[96mstr#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        transport_config: #x1B[96mstr#x1B[39;49;00m | #x1B[94mNone#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    ) -> PactServerHandle:#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""#x1B[39;49;00m
    #x1B[33m    Create a mock server for the provided Pact handle and transport.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    [Rust#x1B[39;49;00m
    #x1B[33m    `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.4.28/pact_ffi/?search=pactffi_create_mock_server_for_transport)#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Args:#x1B[39;49;00m
    #x1B[33m        pact:#x1B[39;49;00m
    #x1B[33m            Handle to the Pact model.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        addr:#x1B[39;49;00m
    #x1B[33m            The address to bind to.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        port:#x1B[39;49;00m
    #x1B[33m            The port number to bind to. A value of zero will result in the#x1B[39;49;00m
    #x1B[33m            operating system allocating an available port.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        transport:#x1B[39;49;00m
    #x1B[33m            The transport to use (i.e. http, https, grpc). The underlying Pact#x1B[39;49;00m
    #x1B[33m            library will interpret this, typically in a case-sensitive way.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m        transport_config:#x1B[39;49;00m
    #x1B[33m            Configuration to be passed to the transport. This must be a valid#x1B[39;49;00m
    #x1B[33m            JSON string, or `None` if not required.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Returns:#x1B[39;49;00m
    #x1B[33m        A handle to the mock server.#x1B[39;49;00m
    #x1B[33m#x1B[39;49;00m
    #x1B[33m    Raises:#x1B[39;49;00m
    #x1B[33m        RuntimeError:#x1B[39;49;00m
    #x1B[33m            If the mock server could not be created. The error message will#x1B[39;49;00m
    #x1B[33m            contain details of the error.#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        ret: #x1B[96mint#x1B[39;49;00m = lib.pactffi_create_mock_server_for_transport(#x1B[90m#x1B[39;49;00m
            pact._ref,#x1B[90m#x1B[39;49;00m
            addr.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            port,#x1B[90m#x1B[39;49;00m
            transport.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m),#x1B[90m#x1B[39;49;00m
            (transport_config.encode(#x1B[33m"#x1B[39;49;00m#x1B[33mutf-8#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[94mif#x1B[39;49;00m transport_config #x1B[94melse#x1B[39;49;00m ffi.NULL),#x1B[90m#x1B[39;49;00m
        )#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m ret > #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            #x1B[94mreturn#x1B[39;49;00m PactServerHandle(ret)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m ret == -#x1B[94m1#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAn invalid Pact handle was received: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m2#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33m"#x1B[39;49;00m#x1B[33mInvalid transport_config JSON.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m3#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mPact mock server could not be started for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m4#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mPanick during Pact mock server creation for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melif#x1B[39;49;00m ret == -#x1B[94m5#x1B[39;49;00m:  #x1B[90m# noqa: PLR2004#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAddress is invalid: #x1B[39;49;00m#x1B[33m{#x1B[39;49;00maddr#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = #x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mAn unknown error occurred during Pact mock server creation for #x1B[39;49;00m#x1B[33m{#x1B[39;49;00mpact#x1B[33m}#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
>       #x1B[94mraise#x1B[39;49;00m #x1B[96mRuntimeError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       RuntimeError: Pact mock server could not be started for PactHandle(56207).#x1B[0m

#x1B[1m#x1B[.../src/pact_ffi/__init__.py#x1B[0m:5035: RuntimeError
tests.compatibility_suite.test_v3_provider::test_verifying_an_interaction_with_a_provider_state_with_parameters
Stack Traces | 1.82s run time
fixturefunc = <function the_provider_state_callback_will_receive_a_setup_call_with_parameters.<locals>._ at 0x7fe40d601c60>
request = <FixtureRequest for <Function test_verifying_an_interaction_with_a_provider_state_with_parameters>>
kwargs = {'action': 'setup', 'datatable': [['name', 'age'], ['"Bob"', '22']], 'provider_callback': <MagicMock spec='function' id='140617339147936'>, 'state': 'A user exists'}

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mcall_fixture_func#x1B[39;49;00m(#x1B[90m#x1B[39;49;00m
        fixturefunc: _FixtureFunc[FixtureValue], request: FixtureRequest, kwargs#x1B[90m#x1B[39;49;00m
    ) -> FixtureValue:#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m inspect.isgeneratorfunction(fixturefunc):#x1B[90m#x1B[39;49;00m
            fixturefunc = cast(Callable[..., Generator[FixtureValue]], fixturefunc)#x1B[90m#x1B[39;49;00m
            generator = fixturefunc(**kwargs)#x1B[90m#x1B[39;49;00m
            #x1B[94mtry#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                fixture_result = #x1B[96mnext#x1B[39;49;00m(generator)#x1B[90m#x1B[39;49;00m
            #x1B[94mexcept#x1B[39;49;00m #x1B[96mStopIteration#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m #x1B[96mValueError#x1B[39;49;00m(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mrequest.fixturename#x1B[33m}#x1B[39;49;00m#x1B[33m did not yield a value#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m) #x1B[94mfrom#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[94mNone#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator)#x1B[90m#x1B[39;49;00m
            request.addfinalizer(finalizer)#x1B[90m#x1B[39;49;00m
        #x1B[94melse#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            fixturefunc = cast(Callable[..., FixtureValue], fixturefunc)#x1B[90m#x1B[39;49;00m
>           fixture_result = fixturefunc(**kwargs)#x1B[90m#x1B[39;49;00m
                             ^^^^^^^^^^^^^^^^^^^^^#x1B[90m#x1B[39;49;00m

#x1B[1m#x1B[31m..../test/lib/python3.13.../site-packages/_pytest/fixtures.py#x1B[0m:915: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[.../compatibility_suite/util/provider.py#x1B[0m:1291: in _
    #x1B[0mprovider_callback.assert_called()#x1B[90m#x1B[39;49;00m
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock spec='function' id='140617339147936'>

    #x1B[0m#x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92massert_called#x1B[39;49;00m(#x1B[96mself#x1B[39;49;00m):#x1B[90m#x1B[39;49;00m
    #x1B[90m    #x1B[39;49;00m#x1B[33m"""assert that the mock was called at least once#x1B[39;49;00m
    #x1B[33m    """#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.call_count == #x1B[94m0#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
            msg = (#x1B[33m"#x1B[39;49;00m#x1B[33mExpected #x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m%s#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[33m to have been called.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m %#x1B[90m#x1B[39;49;00m
                   (#x1B[96mself#x1B[39;49;00m._mock_name #x1B[95mor#x1B[39;49;00m #x1B[33m'#x1B[39;49;00m#x1B[33mmock#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m))#x1B[90m#x1B[39;49;00m
>           #x1B[94mraise#x1B[39;49;00m #x1B[96mAssertionError#x1B[39;49;00m(msg)#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           AssertionError: Expected 'mock' to have been called.#x1B[0m

#x1B[1m#x1B[31m../...../_temp/uv-python-dir/cpython-3.13.9-linux-x86_64-gnu/lib/python3.13/unittest/mock.py#x1B[0m:948: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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 this pull request may close these issues.

2 participants