Skip to content

Commit c700c6a

Browse files
Peter Wilhelmsson2hdddg
authored andcommitted
Flaky test that were sensitive to order of resolver
No need to accept both ipv4 and ipv6 in a test that tests custom resolver. The test was sensitive to the order when both ipv4 and ipv6 were resolved. Now only resolves to ipv4.
1 parent 7a10417 commit c700c6a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/unit/test_addressing.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,12 @@ def test_address_resolve_with_custom_resolver():
233233
custom_resolver = lambda a: [("127.0.0.1", 7687), ("localhost", 1234)]
234234

235235
address = Address(("127.0.0.1", 7687))
236-
resolved = address.resolve(resolver=custom_resolver)
236+
resolved = address.resolve(family=AF_INET, resolver=custom_resolver)
237237
assert isinstance(resolved, Address) is False
238238
assert isinstance(resolved, list) is True
239239
if len(resolved) == 2:
240240
# IPv4 only
241241
assert resolved[0] == IPv4Address(('127.0.0.1', 7687))
242242
assert resolved[1] == IPv4Address(('127.0.0.1', 1234))
243-
elif len(resolved) == 3:
244-
# IPv4 and IPv6
245-
assert resolved[0] == IPv4Address(('127.0.0.1', 7687))
246-
assert resolved[1] == IPv6Address(('::1', 1234, 0, 0))
247-
assert resolved[2] == IPv4Address(('127.0.0.1', 1234))
248243
else:
249244
assert False

0 commit comments

Comments
 (0)