From 6cc4ce00eeed7ab066c848637b4d06381d161a11 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 23 Jul 2021 08:56:15 +0200 Subject: [PATCH 118/N] Update smoketests --- .../smoketests.py => mingw_smoketests.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) rename .github/workflows/smoketests.py => mingw_smoketests.py (90%) diff --git a/.github/workflows/smoketests.py b/mingw_smoketests.py similarity index 90% rename from .github/workflows/smoketests.py rename to mingw_smoketests.py index d8f76e6..3f41855 100644 --- a/.github/workflows/smoketests.py +++ b/mingw_smoketests.py @@ -27,15 +27,41 @@ Feel free to extend. import os import unittest +import sysconfig if "MSYSTEM" in os.environ: SEP = "/" else: SEP = "\\" +_UCRT = "clang" in sysconfig.get_platform() or "ucrt" in sysconfig.get_platform() + class Tests(unittest.TestCase): + def test_ctypes_find_library(self): + from ctypes.util import find_library + from ctypes import cdll + self.assertTrue(cdll.msvcrt) + if _UCRT: + self.assertIsNone(find_library('c')) + else: + self.assertEqual(find_library('c'), 'msvcrt.dll') + + def test_ctypes_dlopen(self): + import ctypes + import sys + self.assertEqual(ctypes.RTLD_GLOBAL, 0) + self.assertEqual(ctypes.RTLD_GLOBAL, ctypes.RTLD_LOCAL) + self.assertFalse(hasattr(sys, 'setdlopenflags')) + self.assertFalse(hasattr(sys, 'getdlopenflags')) + self.assertFalse([n for n in dir(os) if n.startswith("RTLD_")]) + + def test_strftime(self): + import time + with self.assertRaises(ValueError): + time.strftime('%Y', (12345,) + (0,) * 8) + def test_sep(self): self.assertEqual(os.sep, SEP) @@ -66,6 +92,7 @@ class Tests(unittest.TestCase): import sqlite3 import ssl import ctypes + import curses def test_socket_inet_ntop(self): import socket -- 2.32.0