Skip to content

Commit 6f9bd9c

Browse files
miss-islingtonStanFromIrelandpganssle
authored
[3.15] gh-120965: Skip test_zoneinfo.ExtensionBuiltTest if C extension is not available (GH-131104) (#160470)
(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 6dddf0b commit 6f9bd9c

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
@@ -2201,6 +2202,8 @@ def test_pydatetime(self):
22012202
PYTHONTZPATH=str(ZONEINFO_DATA.tzpath))
22022203

22032204

2205+
@unittest.skipIf(sys.modules.get("_zoneinfo") is None,
2206+
"_zoneinfo C module not available")
22042207
class ExtensionBuiltTest(unittest.TestCase):
22052208
"""Smoke test to ensure that the C and Python extensions are both tested.
22062209

0 commit comments

Comments
 (0)