Skip to content

Commit 564ca3a

Browse files
committed
Fix test_cross_language_works_for_subclasses CI failure
Add missing @force_not_colorized decorator to three cross-language test methods. The CPython C-level traceback path includes ANSI color codes in error output, causing assertEndsWith to fail when the expected string doesn't account for trailing escape sequences. Also add the decorator to test_cross_language_levenshtein_fallback and test_cross_language_no_hint_for_unknown_attr for consistency with all other cross-language tests.
1 parent e2c12ec commit 564ca3a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_traceback.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4598,16 +4598,19 @@ def test_cross_language(self):
45984598
actual = self.get_suggestion(obj, attr)
45994599
self.assertEndsWith(actual, expected)
46004600

4601+
@force_not_colorized
46014602
def test_cross_language_levenshtein_fallback(self):
46024603
# When no cross-language entry exists, Levenshtein still works
46034604
# (e.g., trim->strip is not in the table but Levenshtein catches it)
46044605
actual = self.get_suggestion('', 'trim')
46054606
self.assertIn("strip", actual)
46064607

4608+
@force_not_colorized
46074609
def test_cross_language_no_hint_for_unknown_attr(self):
46084610
actual = self.get_suggestion([], 'completely_unknown_method')
46094611
self.assertNotIn("Did you mean", actual)
46104612

4613+
@force_not_colorized
46114614
def test_cross_language_works_for_subclasses(self):
46124615
# isinstance() check means subclasses also get hints
46134616
class MyList(list):

0 commit comments

Comments
 (0)