]> granicus.if.org Git - python/commitdiff
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 10 Jan 2014 13:06:59 +0000 (15:06 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 10 Jan 2014 13:06:59 +0000 (15:06 +0200)
ifconfig executable is not available.

Lib/test/test_uuid.py
Misc/NEWS

index 072734e7286f31cd314ae06df97921d05ac2bef5..72648089b7c9e15a76e19e28d4d41562b67c11a5 100644 (file)
@@ -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',
index 65cb2450e7bd1e2fafcee6a7b9aa5befdba0653f..88f718ed9538d249b37fa5f18f45c629f68950bc 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -234,6 +234,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.
 
 - Issue #20055: Fix test_shutil under Windows with symlink privileges held.