Skip to content

Commit

Permalink
Merge pull request python#15 from paulmon/win-arm32-fix-tests
Browse files Browse the repository at this point in the history
Win arm32 fix tests
  • Loading branch information
paulmon authored Nov 21, 2018
2 parents 25597a5 + f8be65d commit abaaa92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def _syscmd_ver(system='', release='', version='',
}

def win32_is_iot(isIot=False):
if win32_editionId() == 'IoTUAP' or win32_editionId() == 'NanoServer':
if win32_editionId() in ('IoTUAP', 'NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'):
return True
return False

Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_mimetypes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import io
import locale
import mimetypes
import platform
import sys
import unittest

from test import support
from platform import win32_editionId

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

@unittest.skipIf(platform.win32_editionId() == 'NanoServer', "mime types registry keys not available on NanoServer")
@unittest.skipIf(win32_editionId() in ('NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS'), "mime types registry keys not available on NanoServer")
def test_registry_parsing(self):
# the original, minimum contents of the MIME database in the
# Windows registry is undocumented AFAIK.
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import mmap
import os
import pickle
import platform
import shutil
import signal
import socket
Expand All @@ -29,6 +28,7 @@
import uuid
import warnings
from test import support
from platform import win32_is_iot

try:
import resource
Expand Down Expand Up @@ -2285,7 +2285,7 @@ def test_bad_fd(self):
# Return None when an fd doesn't actually exist.
self.assertIsNone(os.device_encoding(123456))

@unittest.skipUnless(os.isatty(0) and not platform.win32_editionId() == 'NanoServer' and (sys.platform.startswith('win') or
@unittest.skipUnless(os.isatty(0) and not win32_is_iot() and (sys.platform.startswith('win') or
(hasattr(locale, 'nl_langinfo') and hasattr(locale, 'CODESET'))),
'test requires a tty and either Windows or nl_langinfo(CODESET)')
def test_device_encoding(self):
Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_winreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from test import support
import threading
from platform import machine
from platform import machine, win32_editionId

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

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

0 comments on commit abaaa92

Please sign in to comment.