diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2016-09-17 01:57:28 -0500 |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2016-09-17 01:57:28 -0500 |
commit | 211e6337bf6ef7dc7c9a69c90b8faf06932d6126 (patch) | |
tree | de2b3a483b74bb56d679f19de673d4afc8701d67 /Lib/test/test_sysconfig.py | |
parent | 5d4c6d95015015bdc10eba4d6687018d2cc172d3 (diff) | |
download | cpython-211e6337bf6ef7dc7c9a69c90b8faf06932d6126.tar.gz |
Skip a sysconfig test if _ctypes is not available.
Also migrates test_sysconfig to unittest discovery.
Diffstat (limited to 'Lib/test/test_sysconfig.py')
-rw-r--r-- | Lib/test/test_sysconfig.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 091e90522d..d2aa8b4d61 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -5,7 +5,7 @@ import subprocess import shutil 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) import sysconfig @@ -387,7 +387,8 @@ class TestSysConfig(unittest.TestCase): @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test') def test_triplet_in_ext_suffix(self): - import ctypes, platform, re + ctypes = import_module('ctypes') + import platform, re machine = platform.machine() suffix = sysconfig.get_config_var('EXT_SUFFIX') if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine): @@ -435,8 +436,5 @@ class MakefileTests(unittest.TestCase): }) -def test_main(): - run_unittest(TestSysConfig, MakefileTests) - if __name__ == "__main__": - test_main() + unittest.main() |