Commit 0f11d0f7 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #19804: The test_find_mac test in test_uuid is now skipped if the

ifconfig executable is not available.
parent c9da0893
......@@ -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',
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment