Skip to content

Commit ace23be

Browse files
Eclips4pablogsal
authored andcommitted
pythongh-104057: Fix direct invocation of test_super (python#104064)
Signed-off-by: Pablo Galindo <[email protected]>
1 parent 80b7148 commit ace23be

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Lib/test/test_fstring.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,12 @@ def test_mismatched_parens(self):
561561
])
562562
self.assertRaises(SyntaxError, eval, "f'{" + "("*500 + "}'")
563563

564+
@unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
564565
def test_fstring_nested_too_deeply(self):
565566
self.assertAllRaise(SyntaxError,
566567
"f-string: expressions nested too deeply",
567568
['f"{1+2:{1+2:{1+1:{1}}}}"'])
568-
569+
569570
def create_nested_fstring(n):
570571
if n == 0:
571572
return "1+1"
@@ -575,13 +576,13 @@ def create_nested_fstring(n):
575576
self.assertAllRaise(SyntaxError,
576577
"too many nested f-strings",
577578
[create_nested_fstring(160)])
578-
579+
579580
def test_syntax_error_in_nested_fstring(self):
580581
# See gh-104016 for more information on this crash
581582
self.assertAllRaise(SyntaxError,
582583
"invalid syntax",
583584
['f"{1 1:' + ('{f"1:' * 199)])
584-
585+
585586
def test_double_braces(self):
586587
self.assertEqual(f'{{', '{')
587588
self.assertEqual(f'a{{', 'a{')

Lib/test/test_super.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class C:
359359
def method(self):
360360
return super().msg
361361

362-
with patch("test.test_super.super", MySuper) as m:
362+
with patch(f"{__name__}.super", MySuper) as m:
363363
self.assertEqual(C().method(), "super super")
364364

365365
def test_shadowed_dynamic_two_arg(self):
@@ -373,7 +373,7 @@ class C:
373373
def method(self):
374374
return super(1, 2).msg
375375

376-
with patch("test.test_super.super", MySuper) as m:
376+
with patch(f"{__name__}.super", MySuper) as m:
377377
self.assertEqual(C().method(), "super super")
378378
self.assertEqual(call_args, [(1, 2)])
379379

0 commit comments

Comments
 (0)