Skip to content

Commit e5bf734

Browse files
miss-islingtonStanFromIrelandpganssle
authored
[3.14] gh-120965: Skip test_zoneinfo.ExtensionBuiltTest if C extension is not available (GH-131104) (#160469)
(cherry picked from commit 897671b) Co-authored-by: Stan Ulbrych <stan@python.org> Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
1 parent a2916fe commit e5bf734

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
@@ -12,6 +12,7 @@
1212
import re
1313
import shutil
1414
import struct
15+
import sys
1516
import tempfile
1617
import unittest
1718
from datetime import date, datetime, time, timedelta, timezone
@@ -2186,6 +2187,8 @@ def test_pydatetime(self):
21862187
PYTHONTZPATH=str(ZONEINFO_DATA.tzpath))
21872188

21882189

2190+
@unittest.skipIf(sys.modules.get("_zoneinfo") is None,
2191+
"_zoneinfo C module not available")
21892192
class ExtensionBuiltTest(unittest.TestCase):
21902193
"""Smoke test to ensure that the C and Python extensions are both tested.
21912194

0 commit comments

Comments
 (0)