From 044285152d8d37ed38398318366e9b7acb0e7eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Wed, 6 Sep 2023 15:02:14 +0200 Subject: [PATCH] Prevent tests from detecting our fake tzdata package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Lib/test/test_zoneinfo/test_zoneinfo.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py index 3766ceac8385f2..70f3514373d56a 100644 --- a/Lib/test/test_zoneinfo/test_zoneinfo.py +++ b/Lib/test/test_zoneinfo/test_zoneinfo.py @@ -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