Skip to content

Commit abaaa92

Browse files
authored
Merge pull request python#15 from paulmon/win-arm32-fix-tests
Win arm32 fix tests
2 parents 25597a5 + f8be65d commit abaaa92

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Lib/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def _syscmd_ver(system='', release='', version='',
500500
}
501501

502502
def win32_is_iot(isIot=False):
503-
if win32_editionId() == 'IoTUAP' or win32_editionId() == 'NanoServer':
503+
if win32_editionId() in ('IoTUAP', 'NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'):
504504
return True
505505
return False
506506

Lib/test/test_mimetypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import io
22
import locale
33
import mimetypes
4-
import platform
54
import sys
65
import unittest
76

87
from test import support
8+
from platform import win32_editionId
99

1010
# Tell it we don't know about external files:
1111
mimetypes.knownfiles = []
@@ -93,7 +93,7 @@ def tearDown(self):
9393
mimetypes.types_map.clear()
9494
mimetypes.types_map.update(self.original_types_map)
9595

96-
@unittest.skipIf(platform.win32_editionId() == 'NanoServer', "mime types registry keys not available on NanoServer")
96+
@unittest.skipIf(win32_editionId() in ('NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'), "mime types registry keys not available on NanoServer")
9797
def test_registry_parsing(self):
9898
# the original, minimum contents of the MIME database in the
9999
# Windows registry is undocumented AFAIK.

Lib/test/test_os.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import mmap
1616
import os
1717
import pickle
18-
import platform
1918
import shutil
2019
import signal
2120
import socket
@@ -29,6 +28,7 @@
2928
import uuid
3029
import warnings
3130
from test import support
31+
from platform import win32_is_iot
3232

3333
try:
3434
import resource
@@ -2285,7 +2285,7 @@ def test_bad_fd(self):
22852285
# Return None when an fd doesn't actually exist.
22862286
self.assertIsNone(os.device_encoding(123456))
22872287

2288-
@unittest.skipUnless(os.isatty(0) and not platform.win32_editionId() == 'NanoServer' and (sys.platform.startswith('win') or
2288+
@unittest.skipUnless(os.isatty(0) and not win32_is_iot() and (sys.platform.startswith('win') or
22892289
(hasattr(locale, 'nl_langinfo') and hasattr(locale, 'CODESET'))),
22902290
'test requires a tty and either Windows or nl_langinfo(CODESET)')
22912291
def test_device_encoding(self):

Lib/test/test_winreg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import unittest
66
from test import support
77
import threading
8-
from platform import machine
8+
from platform import machine, win32_editionId
99

1010
# Do this first so test will be skipped if module doesn't exist
1111
support.import_module('winreg', required_on=['win'])
@@ -399,6 +399,7 @@ def test_named_arguments(self):
399399
DeleteKeyEx(key=HKEY_CURRENT_USER, sub_key=test_key_name,
400400
access=KEY_ALL_ACCESS, reserved=0)
401401

402+
@unittest.skipIf(win32_editionId() in ('WindowsCoreHeadless', 'IoTEdgeOS'), "APIs not available on WindowsCoreHeadless")
402403
def test_reflection_functions(self):
403404
# Test that we can call the query, enable, and disable functions
404405
# on a key which isn't on the reflection list with no consequences.

0 commit comments

Comments
 (0)