Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf9f75f

Browse files
Eclips4pablogsal
authored andcommitted
gh-104057: Fix direct invocation of test_super (#104064)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
1 parent80b7148 commitcf9f75f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎Lib/test/test_fstring.py‎

Lines changed: 4 additions & 3 deletions
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
deftest_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
defcreate_nested_fstring(n):
570571
ifn==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
deftest_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
deftest_double_braces(self):
586587
self.assertEqual(f'{{','{')
587588
self.assertEqual(f'a{{','a{')

‎Lib/test/test_super.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class C:
359359
defmethod(self):
360360
returnsuper().msg
361361

362-
withpatch("test.test_super.super",MySuper)asm:
362+
withpatch(f"{__name__}.super",MySuper)asm:
363363
self.assertEqual(C().method(),"super super")
364364

365365
deftest_shadowed_dynamic_two_arg(self):
@@ -373,7 +373,7 @@ class C:
373373
defmethod(self):
374374
returnsuper(1,2).msg
375375

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp