Skip to content

Commit

Permalink
Skip scspell tests on Python 3.13+ (#677)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cottsay authored Nov 26, 2024
1 parent fc1cae5 commit 0ada5a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test =
pylint
pytest
pytest-cov
scspell3k>=2.2
scspell3k>=2.2; python_version < "3.13"

[options.packages.find]
exclude =
Expand Down
12 changes: 9 additions & 3 deletions test/test_spell_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Licensed under the Apache License, Version 2.0

from pathlib import Path
import sys

import pytest

Expand All @@ -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',
Expand Down

0 comments on commit 0ada5a7

Please sign in to comment.