Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cce440f

Browse files
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
1 parent 4847e4e commit cce440f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/test_uuid.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import builtins
44
import io
55
import os
6+
import shutil
67
import uuid
78

89
def importable(name):
@@ -369,6 +370,11 @@ def test_find_mac(self):
369370
def mock_popen(cmd):
370371
return io.StringIO(data)
371372

373+
if shutil.which('ifconfig') is None:
374+
path = os.pathsep.join(('/sbin', '/usr/sbin'))
375+
if shutil.which('ifconfig', path=path) is None:
376+
self.skipTest('requires ifconfig')
377+
372378
with support.swap_attr(os, 'popen', mock_popen):
373379
mac = uuid._find_mac(
374380
command='ifconfig',

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ IDLE
234234
Tests
235235
-----
236236

237+
- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
238+
ifconfig executable is not available.
239+
237240
- Issue #19886: Use better estimated memory requirements for bigmem tests.
238241

239242
- Issue #20055: Fix test_shutil under Windows with symlink privileges held.

0 commit comments

Comments
 (0)