Kaydet (Commit) f7cc6035 authored tarafından Zachary Ware's avatar Zachary Ware

Skip a sysconfig test if _ctypes is not available.

Also migrates test_sysconfig to unittest discovery.
üst f40d4ddf
...@@ -5,7 +5,7 @@ import subprocess ...@@ -5,7 +5,7 @@ import subprocess
import shutil import shutil
from copy import copy from copy import copy
from test.support import (run_unittest, TESTFN, unlink, check_warnings, from test.support import (import_module, TESTFN, unlink, check_warnings,
captured_stdout, skip_unless_symlink, change_cwd) captured_stdout, skip_unless_symlink, change_cwd)
import sysconfig import sysconfig
...@@ -387,7 +387,8 @@ class TestSysConfig(unittest.TestCase): ...@@ -387,7 +387,8 @@ class TestSysConfig(unittest.TestCase):
@unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test') @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test')
def test_triplet_in_ext_suffix(self): def test_triplet_in_ext_suffix(self):
import ctypes, platform, re ctypes = import_module('ctypes')
import platform, re
machine = platform.machine() machine = platform.machine()
suffix = sysconfig.get_config_var('EXT_SUFFIX') suffix = sysconfig.get_config_var('EXT_SUFFIX')
if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine): if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
...@@ -435,8 +436,5 @@ class MakefileTests(unittest.TestCase): ...@@ -435,8 +436,5 @@ class MakefileTests(unittest.TestCase):
}) })
def test_main():
run_unittest(TestSysConfig, MakefileTests)
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment