The driver and pppoe_driver fixtures (tests/unit/test_driver.py 246-288) create FritzBoxDriver(hostname="fritz.box", …), set drv.fc to a MagicMock and yield drv without closing it. When the driver is collected, NAPALM's NetworkDriver.__del__ calls is_alive(), and with fc still set that does a real
(napalm_fritzbox/fritzbox.py:159), i.e. a DNS lookup of fritz.box and a TCP connect to port 49443, once per test that used a fixture. In a network with a real FRITZ!Box the connect succeeds; elsewhere each one can wait up to the timeout. Exceptions in __del__ are swallowed, so it only shows up as slow or flaky test runs.
Expected
The fixtures call drv.close() after yield (which sets fc = None, so is_alive returns without touching the network), or patch socket.create_connection for the module. No unit test touches the network.
Priority: P4 — non-hermetic unit tests.
Found during the bug sweep of 2026-11-01.
## What happens
The `driver` and `pppoe_driver` fixtures (`tests/unit/test_driver.py` 246-288) create `FritzBoxDriver(hostname="fritz.box", …)`, set `drv.fc` to a `MagicMock` and `yield drv` without closing it. When the driver is collected, NAPALM's `NetworkDriver.__del__` calls `is_alive()`, and with `fc` still set that does a real
```python
with socket.create_connection((self.hostname, self.port), timeout=5):
```
(`napalm_fritzbox/fritzbox.py:159`), i.e. a DNS lookup of `fritz.box` and a TCP connect to port 49443, once per test that used a fixture. In a network with a real FRITZ!Box the connect succeeds; elsewhere each one can wait up to the timeout. Exceptions in `__del__` are swallowed, so it only shows up as slow or flaky test runs.
## Expected
The fixtures call `drv.close()` after `yield` (which sets `fc = None`, so `is_alive` returns without touching the network), or patch `socket.create_connection` for the module. No unit test touches the network.
Priority: P4 — non-hermetic unit tests.
Found during the bug sweep of 2026-11-01.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
The
driverandpppoe_driverfixtures (tests/unit/test_driver.py246-288) createFritzBoxDriver(hostname="fritz.box", …), setdrv.fcto aMagicMockandyield drvwithout closing it. When the driver is collected, NAPALM'sNetworkDriver.__del__callsis_alive(), and withfcstill set that does a real(
napalm_fritzbox/fritzbox.py:159), i.e. a DNS lookup offritz.boxand a TCP connect to port 49443, once per test that used a fixture. In a network with a real FRITZ!Box the connect succeeds; elsewhere each one can wait up to the timeout. Exceptions in__del__are swallowed, so it only shows up as slow or flaky test runs.Expected
The fixtures call
drv.close()afteryield(which setsfc = None, sois_alivereturns without touching the network), or patchsocket.create_connectionfor the module. No unit test touches the network.Priority: P4 — non-hermetic unit tests.
Found during the bug sweep of 2026-11-01.