Skip to content

Commit 897671b

Browse files
gh-120965: Skip test_zoneinfo.ExtensionBuiltTest if C extension is not available (#131104)
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
1 parent 6d6b1ab commit 897671b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Lib/test/test_zoneinfo/test_zoneinfo.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import re
1414
import shutil
1515
import struct
16+
import sys
1617
import tempfile
1718
import types
1819
import unittest
@@ -2236,6 +2237,8 @@ def test_pydatetime(self):
22362237
PYTHONTZPATH=str(ZONEINFO_DATA.tzpath))
22372238

22382239

2240+
@unittest.skipIf(sys.modules.get("_zoneinfo") is None,
2241+
"_zoneinfo C module not available")
22392242
class ExtensionBuiltTest(unittest.TestCase):
22402243
"""Smoke test to ensure that the C and Python extensions are both tested.
22412244

0 commit comments

Comments
 (0)