File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4619,7 +4619,31 @@ def test_levenshtein_distance_short_circuit(self):
46194619 @cpython_only
46204620 def test_suggestions_extension (self ):
46214621 # Check that the C extension is available
4622- import _suggestions # noqa: F401
4622+ import _suggestions
4623+
4624+ self .assertEqual (
4625+ _suggestions ._generate_suggestions (
4626+ ["hello" , "world" ],
4627+ "hell"
4628+ ),
4629+ "hello"
4630+ )
4631+ self .assertEqual (
4632+ _suggestions ._generate_suggestions (
4633+ ["hovercraft" ],
4634+ "eels"
4635+ ),
4636+ None
4637+ )
4638+
4639+ # gh-131936: _generate_suggestions didn't check for exactly a list
4640+ class MyList (list ):
4641+ pass
4642+
4643+ with self .assertRaises (TypeError ):
4644+ _suggestions ._generate_suggestions (MyList (), "" )
4645+
4646+
46234647
46244648
46254649class TestColorizedTraceback (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments