From 2c2013698e641261454deb0d13da716b6dbe5158 Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Sun, 21 Sep 2025 18:57:55 +0900 Subject: [PATCH] fix: skip incompatible tests on Python 3.11 and earlier --- test/test_query.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_query.py b/test/test_query.py index 897ed58..c471c38 100644 --- a/test/test_query.py +++ b/test/test_query.py @@ -23,6 +23,15 @@ class Tests(unittest.TestCase): + """Test querying tools from several modules. + + Note: + + Tests that run setup script directly fail due to conflict between distutils used internally + by setuptools and distutils used internally by pip. For more information, see: + - https://github.com/pypa/setuptools/issues/3297 + - https://github.com/pypa/pip/issues/8761 + """ def _check_examples_count(self, description, examples): lvl = logging.WARNING if len(examples) < 10 else logging.INFO @@ -87,6 +96,7 @@ def test_query_pkg_info(self): @unittest.skipUnless( os.environ.get('TEST_PACKAGING') or os.environ.get('CI'), 'skipping packaging test') + @unittest.skipIf(sys.version_info < (3, 12), 'requires Python 3.12+') def test_query_pkg_info_current(self): with preserve_logger_level('version_query'): run_module('setup', 'build') @@ -120,6 +130,7 @@ def test_query_package_folder(self): @unittest.skipUnless( os.environ.get('TEST_PACKAGING') or os.environ.get('CI'), 'skipping packaging test') + @unittest.skipIf(sys.version_info < (3, 12), 'requires Python 3.12+') def test_query_package_folder_current(self): with preserve_logger_level('version_query'): run_module('setup', 'build')