From ced8a9c84fca0e25bcfdb2e587ed956a62b14af4 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 ae921f7432c466..d3612f1d167b39 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