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 <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Sep 19, 2023
1 parent 24cd306 commit ced8a9c
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 @@ -24,11 +24,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 ced8a9c

Please sign in to comment.