Skip to content

Commit

Permalink
Prevent tests from detecting our fake tzdata package
Browse files Browse the repository at this point in the history
Tests from test_zoneinfo assume that if `tzdata` package is installed,
it provides standalone timezone data.  Our `tzdata` package is just
a shim, so force falsify that assumption.

Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
mgorny committed Aug 1, 2024
1 parent 6fe5f87 commit 0401ea5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Lib/test/test_zoneinfo/test_zoneinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@
lzma = import_module('lzma')
py_zoneinfo, c_zoneinfo = test_support.get_modules()

try:
importlib.metadata.metadata("tzdata")
HAS_TZDATA_PKG = True
except importlib.metadata.PackageNotFoundError:
HAS_TZDATA_PKG = False
# Gentoo installs a dummy `tzdata` package
HAS_TZDATA_PKG = False

ZONEINFO_DATA = None
ZONEINFO_DATA_V1 = None
Expand Down

0 comments on commit 0401ea5

Please sign in to comment.