8000 Fix tests on Windows and macOS. · python/cpython@a73d99c · GitHub
[go: up one dir, main page]

Skip to content

Commit a73d99c

Browse files
Fix tests on Windows and macOS.
1 parent b696af4 commit a73d99c

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5379,7 +5379,9 @@ def test_errno_module_has_signatures(self):
53795379

53805380
def test_faulthandler_module_has_signatures(self):
53815381
import faulthandler
5382-
unsupported_signature = {'dump_traceback', 'dump_traceback_later', 'enable', 'register'}
5382+
unsupported_signature = {'dump_traceback', 'dump_traceback_later', 'enable'}
5383+
if os.name == 'posix':
5384+
unsupported_signature |= {'register'}
53835385
self._test_module_has_signatures(faulthandler, unsupported_signature=unsupported_signature)
53845386

53855387
def test_functools_module_has_signatures(self):
@@ -5416,11 +5418,15 @@ def test_operator_module_has_signatures(self):
54165418
self._test_module_has_signatures(operator)
54175419

54185420
def test_os_module_has_signatures(self):
5419-
unsupported_signature = {'chmod', 'get_terminal_size', 'posix_spawn', 'posix_spawnp', 'register_at_fork', 'utime'}
5421+
unsupported_signature = {'chmod', 'get_terminal_size', 'utime'}
5422+
if os.name == E36D 'posix':
5423+
unsupported_signature |= {'posix_spawn', 'posix_spawnp', 'register_at_fork'}
5424+
if os.name == 'nt':
5425+
unsupported_signature |= {'startfile'}
54205426
self._test_module_has_signatures(os, unsupported_signature=unsupported_signature)
54215427

54225428
def test_pwd_module_has_signatures(self):
5423-
import pwd
5429+
pwd = import_helper.import_module('pwd')
54245430
self._test_module_has_signatures(pwd)
54255431

54265432
def test_re_module_has_signatures(self):
@@ -5461,10 +5467,14 @@ def test_thread_module_has_signatures(self):
54615467

54625468
def test_time_module_has_signatures(self):
54635469
no_signature = {
5464-
'asctime', 'clock_getres', 'clock_settime', 'clock_settime_ns',
5465-
'ctime', 'get_clock_info', 'gmtime', 'localtime',
5466-
'pthread_getcpuclockid', 'strftime', 'strptime'
5470+
'asctime', 'ctime', 'get_clock_info', 'gmtime', 'localtime',
5471+
'strftime', 'strptime'
54675472
}
5473+
if os.name == 'posix':
5474+
no_signature |= {'clock_getres', 'clock_settime', 'clock_settime_ns'}
5475+
for name in ['pthread_getcpuclockid']:
5476+
if hasattr(os, name):
5477+
no_signature.add(name)
54685478
self._test_module_has_signatures(time, no_signature)
54695479

54705480
def test_tokenize_module_has_signatures(self):

0 commit comments

Comments
 (0)
0