summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-10 13:05:27 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-10 13:05:27 (GMT)
commit0f11d0f778dca3bbaead1d8e2ec71067687d0296 (patch)
tree8d8ac565d29d8e8adfda9c87fd6feaa587c0d767
parentc9da0893d3b49b99e29e95276437d792c6ac0c9a (diff)
downloadcpython-0f11d0f778dca3bbaead1d8e2ec71067687d0296.zip
cpython-0f11d0f778dca3bbaead1d8e2ec71067687d0296.tar.gz
cpython-0f11d0f778dca3bbaead1d8e2ec71067687d0296.tar.bz2
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
-rw-r--r--Lib/test/test_uuid.py11
-rw-r--r--Misc/NEWS3
2 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py
index e623417..5ba6845 100644
--- a/Lib/test/test_uuid.py
+++ b/Lib/test/test_uuid.py
@@ -358,6 +358,17 @@ eth0 Link encap:Ethernet HWaddr 12:34:56:78:90:ab
def mock_popen(cmd):
return io.BytesIO(data)
+ path = os.environ.get("PATH", os.defpath).split(os.pathsep)
+ path.extend(('/sbin', '/usr/sbin'))
+ for dir in path:
+ executable = os.path.join(dir, 'ifconfig')
+ if (os.path.exists(executable) and
+ os.access(executable, os.F_OK | os.X_OK) and
+ not os.path.isdir(executable)):
+ break
+ else:
+ self.skipTest('requires ifconfig')
+
with test_support.swap_attr(os, 'popen', mock_popen):
mac = uuid._find_mac(
command='ifconfig',
diff --git a/Misc/NEWS b/Misc/NEWS
index 5999b11..ddcf535 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -161,6 +161,9 @@ IDLE
Tests
-----
+- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
+ ifconfig executable is not available.
+
- Issue #19886: Use better estimated memory requirements for bigmem tests.
- Backported tests for Tkinter variables.