]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Do not catch TypeError in test_resolve_hostaddr_async_bad()
authorDenis Laxalde <denis.laxalde@dalibo.com>
Thu, 4 Nov 2021 15:04:38 +0000 (16:04 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 10 Nov 2021 01:57:39 +0000 (02:57 +0100)
It appears that only psycopg.OperationalError is actually raised.

tests/test_dns.py

index 59affcbcbc22e8109a79e149d6925340e419eef6..480aec193068081444fd5dea75206c1905635de8 100644 (file)
@@ -119,7 +119,7 @@ async def test_resolve_hostaddr_async_bad(
         for k, v in env.items():
             monkeypatch.setenv(k, v)
     params = conninfo_to_dict(conninfo)
-    with pytest.raises((TypeError, psycopg.Error)):
+    with pytest.raises(psycopg.Error):
         await psycopg._dns.resolve_hostaddr_async(  # type: ignore[attr-defined]
             params
         )