From 1736f537eb85bcfe58e1ae854a45d5b79fe12996 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 27 Dec 2021 10:19:30 +0100 Subject: [PATCH] tests: fix tests on Ubuntu 22.04 I added a test for sysconfig.parse_config_h() in 9d0b8cda407 which assumed pyconfig.h always has some macros defined and checked that the result was non-empty. On Ubuntu 22.04 the pyconfig.h is just a shim, including various platform specific configs and not defining anything directly. This changes the test to not assume anything about the output of parse_config_h() instead. --- distutils/tests/test_sysconfig.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/distutils/tests/test_sysconfig.py b/distutils/tests/test_sysconfig.py index d28f47120e..c7989d68a0 100644 --- a/distutils/tests/test_sysconfig.py +++ b/distutils/tests/test_sysconfig.py @@ -288,11 +288,10 @@ def test_parse_config_h(self): input = {} with open(config_h, encoding="utf-8") as f: result = sysconfig.parse_config_h(f, g=input) - self.assertTrue(input) self.assertTrue(input is result) with open(config_h, encoding="utf-8") as f: result = sysconfig.parse_config_h(f) - self.assertTrue(result) + self.assertTrue(isinstance(result, dict)) def test_suite(): suite = unittest.TestSuite()