Skip to content

Commit 1ea0f73

Browse files
committed
fix windows tests
1 parent 9bc4012 commit 1ea0f73

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_ctypes/test_dlerror.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def test_null_dlsym(self):
115115
_ctypes.dlsym(L, "foo")
116116

117117

118+
@unittest.skipUnless(os.name != 'nt', 'test requires dlerror() calls')
118119
class TestLocalization(unittest.TestCase):
119120

120121
@staticmethod
@@ -148,7 +149,7 @@ def test_localized_error_from_dll(self):
148149
with self.assertRaises(AttributeError) as cm:
149150
dll.foo
150151
if sys.platform.startswith('linux'):
151-
# On macOS or Windows, the filename is not reported by dlerror()
152+
# On macOS, the filename is not reported by dlerror().
152153
self.assertIn('test_from_dll.so', str(cm.exception))
153154

154155
@configure_locales
@@ -159,7 +160,7 @@ def test_localized_error_in_dll(self):
159160
with self.assertRaises(ValueError) as cm:
160161
c_int.in_dll(dll, 'foo')
161162
if sys.platform.startswith('linux'):
162-
# On macOS or Windows, the filename is not reported by dlerror()
163+
# On macOS, the filename is not reported by dlerror().
163164
self.assertIn('test_in_dll.so', str(cm.exception))
164165

165166
@unittest.skipUnless(hasattr(_ctypes, 'dlopen'),
@@ -187,7 +188,7 @@ def test_localized_error_dlsym(self):
187188
with self.assertRaises(OSError) as cm:
188189
_ctypes.dlsym(dll, 'foo')
189190
if sys.platform.startswith('linux'):
190-
# On macOS or Windows, the filename is not reported by dlerror()
191+
# On macOS, the filename is not reported by dlerror().
191192
self.assertIn('test_dlsym.so', str(cm.exception))
192193

193194

0 commit comments

Comments
 (0)