File: fix_test_expecting_public_ip_addr.patch

package info (click to toggle)
ipyparallel 8.8.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 21,991; javascript: 267; makefile: 29; sh: 28
file content (29 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Joseph Nahmias <joe@nahmias.net>
Date: Wed, 30 Oct 2024 15:14:29 +0100
Subject: Fix test expecting the machine to have a public IP Address

Last-Update: 2020-09-06
Forwarded: not-needed
---
 ipyparallel/tests/test_util.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipyparallel/tests/test_util.py b/ipyparallel/tests/test_util.py
index 8d7c080..49d2e05 100644
--- a/ipyparallel/tests/test_util.py
+++ b/ipyparallel/tests/test_util.py
@@ -8,7 +8,6 @@ from ipyparallel import util
 
 def test_disambiguate_ip():
     # garbage in, garbage out
-    public_ip = public_ips()[0]
     assert util.disambiguate_ip_address('garbage') == 'garbage'
     assert util.disambiguate_ip_address('0.0.0.0', socket.gethostname()) == localhost()
     wontresolve = 'this.wontresolve.dns'
@@ -16,4 +15,5 @@ def test_disambiguate_ip():
         RuntimeWarning, match=f"IPython could not determine IPs for {wontresolve}"
     ):
         assert util.disambiguate_ip_address('0.0.0.0', wontresolve) == wontresolve
-    assert util.disambiguate_ip_address('0.0.0.0', public_ip) == localhost()
+    for ip in public_ips():
+        assert util.disambiguate_ip_address('0.0.0.0', ip) == localhost()