Skip to content

Commit 8435e2b

Browse files
Use the proper skip and separation in tests
1 parent e4efefe commit 8435e2b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/checkers/unittest_spelling.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ def _get_msg_suggestions(self, word: str, count: int = 4) -> str:
4040
suggestions = "' or '".join(self.checker.spelling_dict.suggest(word)[:count])
4141
return f"'{suggestions}'"
4242

43-
def test_spelling_dict_help(self) -> None:
43+
def test_spelling_dict_help_no_enchant(self) -> None:
4444
assert "both the python package and the system dep" in _get_enchant_dict_help(
4545
[], pyenchant_available=False
4646
)
4747
assert "need to install the system dep" in _get_enchant_dict_help(
4848
[], pyenchant_available=True
4949
)
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.")
50+
51+
@skip_on_missing_package_or_dict
52+
def test_spelling_dict_help_enchant(self) -> None:
53+
assert "Available dictionaries: " in _get_enchant_dict_help(
54+
enchant.Broker().list_dicts(), pyenchant_available=True
55+
)
5656

5757
@skip_on_missing_package_or_dict
5858
@set_config(spelling_dict=spell_dict)

0 commit comments

Comments
 (0)