diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-10-19 22:06:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 22:06:05 (GMT) |
commit | 5456e78f4593edc277ab72fb9a9db1ebae7d4c2d (patch) | |
tree | 5cd3f92044f0287dbd6724a89f3276939a9b975d /Lib/ctypes/test | |
parent | 33242a9328cb3912f02819d2d092bf89681000b2 (diff) | |
download | cpython-5456e78f4593edc277ab72fb9a9db1ebae7d4c2d.zip cpython-5456e78f4593edc277ab72fb9a9db1ebae7d4c2d.tar.gz cpython-5456e78f4593edc277ab72fb9a9db1ebae7d4c2d.tar.bz2 |
bpo-16396: Allow wintypes to be imported on non-Windows systems. (GH-21394)
Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r-- | Lib/ctypes/test/test_wintypes.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/ctypes/test/test_wintypes.py b/Lib/ctypes/test/test_wintypes.py index 71442df..243d596 100644 --- a/Lib/ctypes/test/test_wintypes.py +++ b/Lib/ctypes/test/test_wintypes.py @@ -1,12 +1,13 @@ -import sys import unittest +# also work on POSIX + from ctypes import * +from ctypes import wintypes + -@unittest.skipUnless(sys.platform.startswith('win'), 'Windows-only test') class WinTypesTest(unittest.TestCase): def test_variant_bool(self): - from ctypes import wintypes # reads 16-bits from memory, anything non-zero is True for true_value in (1, 32767, 32768, 65535, 65537): true = POINTER(c_int16)(c_int16(true_value)) @@ -37,5 +38,6 @@ class WinTypesTest(unittest.TestCase): vb.value = [] self.assertIs(vb.value, False) + if __name__ == "__main__": unittest.main() |