#2341·fabric

Test failure when building for nixpkgs (in `tests/connection.py`)

Author: sarahecCreated Jul 15, 2025Updated Aug 10, 2026
LabelsTestsBugNeeds investigation

Describe the bug A clear and concise description of what the bug is.

bash
=================================== FAILURES ===================================
_______ Connection_.basic_attributes.client_defaults_to_a_new_SSHClient ________

self = <connection.Connection_.basic_attributes object at 0x7ffff4d0bd90>

    def client_defaults_to_a_new_SSHClient(self):
        c = Connection("host").client
>       assert isinstance(c, SSHClient)
E       AssertionError: assert False
E        +  where False = isinstance(<MagicMock name='SSHClient()' id='140737262531120'>, SSHClient)

tests/connection.py:61: AssertionError
____________ Connection_.known_hosts_behavior.defaults_to_auto_add _____________

self = <connection.Connection_.known_hosts_behavior object at 0x7ffff4d0bb10>

    def defaults_to_auto_add(self):
        # TODO: change Paramiko API so this isn't a private access
        # TODO: maybe just merge with the __init__ test that is similar
>       assert isinstance(Connection("host").client._policy, AutoAddPolicy)
E       AssertionError: assert False
E        +  where False = isinstance(<MagicMock name='SSHClient()._policy' id='140737262998864'>, AutoAddPolicy)
E        +    where <MagicMock name='SSHClient()._policy' id='140737262998864'> = <MagicMock name='SSHClient()' id='140737262531120'>._policy
E        +      where <MagicMock name='SSHClient()' id='140737262531120'> = <Connection host=host>.client
E        +        where <Connection host=host> = Connection('host')

tests/connection.py:68: AssertionError

To Reproduce After installing nix, and checking out https://github.com/NixOS/nixpkgs: nix-build -A python313Packages.fabric

Expected behaviour A clean build and test.

Environment

Happens with or without the build sandbox. python3Packages.invoke @ 2.2.0 python3Packages.paramiko @ 3.5.1 python3Packages.fabric is at 3.2.2