Skip to content

Commit 9da5071

Browse files
committed
mypy: disallow_untyped_calls
1 parent 5734e5e commit 9da5071

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ disallow_subclassing_any = true
44

55
check_untyped_defs = true
66
disallow_incomplete_defs = true
7-
# disallow_untyped_calls = true
7+
disallow_untyped_calls = true
88
disallow_untyped_decorators = true
99
disallow_untyped_defs = true
1010

tests/mocked_dns_response.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import Any, Dict, Iterator, Optional
22

3+
import dns.exception
34
import dns.rdataset
45
import dns.resolver
56
import json
@@ -91,7 +92,7 @@ def save(self) -> None:
9192
def get(self, key: dns.resolver.CacheKey) -> Optional[Ans]:
9293
# Special-case a domain to create a timeout.
9394
if key[0].to_text() == "timeout.com.":
94-
raise dns.exception.Timeout()
95+
raise dns.exception.Timeout() # type: ignore [no-untyped-call]
9596

9697
# When building the DNS response database, return
9798
# a cache miss.
@@ -101,13 +102,13 @@ def get(self, key: dns.resolver.CacheKey) -> Optional[Ans]:
101102
# Query the data for a matching record.
102103
if key in self.data:
103104
if not self.data[key]:
104-
raise dns.resolver.NoAnswer()
105+
raise dns.resolver.NoAnswer() # type: ignore [no-untyped-call]
105106
return self.data[key]
106107

107108
# Query the data for a response to an ANY query.
108109
ANY = dns.rdatatype.from_text("ANY")
109110
if (key[0], ANY, key[2]) in self.data and self.data[(key[0], ANY, key[2])] is None:
110-
raise dns.resolver.NXDOMAIN()
111+
raise dns.resolver.NXDOMAIN() # type: ignore [no-untyped-call]
111112

112113
raise ValueError(f"Saved DNS data did not contain query: {key}")
113114

0 commit comments

Comments
 (0)