Examining the pytest.raises excinfo object should be done outside the
with statement block. Previously, the raised exception prevented the
assert from being executed.
Per the docs:
https://docs.pytest.org/en/latest/how-to/assert.html#assertions-about-expected-exceptions
The exception is the "value" attribute, not "info".
mypy also caught this mistake:
tests/unit/test_network_utils.py:23: error:
"ExceptionInfo[NetworkConnectionError]" has no attribute "info" [attr-defined]
assert str(exc.info) == (