Skip to content

Commit 8c1ec59

Browse files
authored
Merge pull request #31 from mbdevpl/feature/fix-tests-in-py11-and-earlier
skip incompatible tests on Python 3.11 and earlier
2 parents 4d6f16f + 2c20136 commit 8c1ec59

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test_query.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323

2424

2525
class Tests(unittest.TestCase):
26+
"""Test querying tools from several modules.
27+
28+
Note:
29+
30+
Tests that run setup script directly fail due to conflict between distutils used internally
31+
by setuptools and distutils used internally by pip. For more information, see:
32+
- https://github.com/pypa/setuptools/issues/3297
33+
- https://github.com/pypa/pip/issues/8761
34+
"""
2635

2736
def _check_examples_count(self, description, examples):
2837
lvl = logging.WARNING if len(examples) < 10 else logging.INFO
@@ -87,6 +96,7 @@ def test_query_pkg_info(self):
8796

8897
@unittest.skipUnless(
8998
os.environ.get('TEST_PACKAGING') or os.environ.get('CI'), 'skipping packaging test')
99+
@unittest.skipIf(sys.version_info < (3, 12), 'requires Python 3.12+')
90100
def test_query_pkg_info_current(self):
91101
with preserve_logger_level('version_query'):
92102
run_module('setup', 'build')
@@ -120,6 +130,7 @@ def test_query_package_folder(self):
120130

121131
@unittest.skipUnless(
122132
os.environ.get('TEST_PACKAGING') or os.environ.get('CI'), 'skipping packaging test')
133+
@unittest.skipIf(sys.version_info < (3, 12), 'requires Python 3.12+')
123134
def test_query_package_folder_current(self):
124135
with preserve_logger_level('version_query'):
125136
run_module('setup', 'build')

0 commit comments

Comments
 (0)