mirror of
https://github.com/python/cpython.git
synced 2025-09-28 11:15:17 +00:00
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
This commit is contained in:
commit
50471db565
2 changed files with 9 additions and 0 deletions
|
@ -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',
|
||||
|
|
|
@ -389,6 +389,9 @@ IDLE
|
|||
Tests
|
||||
-----
|
||||
|
||||
- Issue #19804: The test_find_mac test in test_uuid is now skipped if the
|
||||
ifconfig executable is not available.
|
||||
|
||||
- Issue #20055: Fix test_shutil under Windows with symlink privileges held.
|
||||
Patch by Vajrasky Kok.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue