summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-10 13:08:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-10 13:08:07 (GMT)
commit50471db5653dba16b6c149ee43a0ab5c2a027ef8 (patch)
treea38f2e183aff7deb29828e3e03621b67ce95a71f /Lib/test
parenta6dec2e74426ea0ae271c31523d4c6c9e60aa9c7 (diff)
parentcce440fab84dc4a3beec755894ac2daa57e173ec (diff)
downloadcpython-50471db5653dba16b6c149ee43a0ab5c2a027ef8.zip
cpython-50471db5653dba16b6c149ee43a0ab5c2a027ef8.tar.gz
cpython-50471db5653dba16b6c149ee43a0ab5c2a027ef8.tar.bz2
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_uuid.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py
index 072734e..7264808 100644
--- a/Lib/test/test_uuid.py
+++ b/Lib/test/test_uuid.py
@@ -3,6 +3,7 @@ from test import support
import builtins
import io
import os
+import shutil
import uuid
def importable(name):
@@ -369,6 +370,11 @@ eth0 Link encap:Ethernet HWaddr 12:34:56:78:90:ab
def mock_popen(cmd):
return io.StringIO(data)
+ if shutil.which('ifconfig') is None:
+ path = os.pathsep.join(('/sbin', '/usr/sbin'))
+ if shutil.which('ifconfig', path=path) is None:
+ self.skipTest('requires ifconfig')
+
with support.swap_attr(os, 'popen', mock_popen):
mac = uuid._find_mac(
command='ifconfig',