From 0d8a907cabc9351868005bdde253765a1b4b9fb2 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 25 Nov 2024 10:32:46 -0600 Subject: [PATCH] Skip scspell tests on Python 3.13+ At this time, scspell is not available for Python 3.13 due to the removal of lib2to3. Until we have another solution, we should skip scspell on Python 3.13 so that we can add that version to the CI matrix as soon as possible. --- setup.cfg | 2 +- test/test_spell_check.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index 91dd713c..3827c72d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -59,7 +59,7 @@ test = pylint pytest pytest-cov - scspell3k>=2.2 + scspell3k>=2.2; python_version < "3.13" [options.packages.find] exclude = diff --git a/test/test_spell_check.py b/test/test_spell_check.py index 10e5725d..8ab0de48 100644 --- a/test/test_spell_check.py +++ b/test/test_spell_check.py @@ -2,6 +2,7 @@ # Licensed under the Apache License, Version 2.0 from pathlib import Path +import sys import pytest @@ -16,9 +17,14 @@ def known_words(): @pytest.mark.linter def test_spell_check(known_words): - from scspell import Report - from scspell import SCSPELL_BUILTIN_DICT - from scspell import spell_check + try: + from scspell import Report + from scspell import SCSPELL_BUILTIN_DICT + from scspell import spell_check + except ModuleNotFoundError: + if sys.version_info >= (3, 13): + pytest.skip('scspell3k is not available for Python 3.13+') + raise source_filenames = [ Path(__file__).parents[1] / 'bin' / 'colcon',