Skip to content

Commit d9670ba

Browse files
authored
Merge pull request #926 from ellert/no-public-ip
Don't fail a test because there are no public IP addresses
2 parents e204e8c + 24008ff commit d9670ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ipyparallel/tests/test_util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88

99
def test_disambiguate_ip():
1010
# garbage in, garbage out
11-
public_ip = public_ips()[0]
1211
assert util.disambiguate_ip_address('garbage') == 'garbage'
1312
assert util.disambiguate_ip_address('0.0.0.0', socket.gethostname()) == localhost()
1413
wontresolve = 'this.wontresolve.dns'
1514
with pytest.warns(
1615
RuntimeWarning, match=f"IPython could not determine IPs for {wontresolve}"
1716
):
1817
assert util.disambiguate_ip_address('0.0.0.0', wontresolve) == wontresolve
19-
assert util.disambiguate_ip_address('0.0.0.0', public_ip) == localhost()
18+
if public_ips():
19+
public_ip = public_ips()[0]
20+
assert util.disambiguate_ip_address('0.0.0.0', public_ip) == localhost()

0 commit comments

Comments
 (0)