Skip to content

Commit 9aa359d

Browse files
Skip tests if enchant is not installed
1 parent 72de85a commit 9aa359d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/checkers/unittest_spelling.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ def test_spelling_dict_help(self) -> None:
4747
assert "need to install the system dep" in _get_enchant_dict_help(
4848
[], pyenchant_available=True
4949
)
50-
assert "Available dictionaries: " in _get_enchant_dict_help(
51-
enchant.Broker().list_dicts(), pyenchant_available=True
52-
)
50+
if enchant is not None:
51+
assert "Available dictionaries: " in _get_enchant_dict_help(
52+
enchant.Broker().list_dicts(), pyenchant_available=True
53+
)
54+
else:
55+
pytest.skip("'enchant' is not installed.")
5356

5457
@skip_on_missing_package_or_dict
5558
@set_config(spelling_dict=spell_dict)

0 commit comments

Comments
 (0)