Skip to content

Commit 22ac8be

Browse files
committed
Use a test that actually aborts on 3.12, still not testing the code change in 3.14.
1 parent 4586bba commit 22ac8be

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Lib/test/test_traceback.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4073,15 +4073,12 @@ class A:
40734073
self.assertNotIn("blech", actual)
40744074

40754075
def test_suggestions_do_not_trigger_with_non_string_candidates(self):
4076-
class Parent:
4077-
def __dir__(self):
4078-
return [0, 'blech']
4079-
4080-
class WithNonStringAttrs(Parent):
4081-
blech = None
4076+
def run_module_code():
4077+
import runpy
4078+
runpy._run_module_code("blech", {0: "", "bluch": ""}, "")
40824079

4083-
result = self.get_suggestion(WithNonStringAttrs(), "bluch")
4084-
self.assertNotIn("blech", result)
4080+
actual = self.get_exception(run_module_code, slice_start=-1, slice_end=None)
4081+
self.assertNotIn("bluch", actual[0])
40854082

40864083
def test_getattr_suggestions_no_args(self):
40874084
class A:

0 commit comments

Comments
 (0)