Skip to content

Commit 954bbcc

Browse files
[3.12] gh-108303: Remove Lib/test/shadowed_super.py (GH-114372) (#114433)
gh-108303: Remove `Lib/test/shadowed_super.py` (GH-114372) Move code into Lib/test/test_super.py. (cherry picked from commit 2ef520e) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent 1bd2c93 commit 954bbcc

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Lib/test/shadowed_super.py

-7
This file was deleted.

Lib/test/test_super.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""Unit tests for zero-argument super() & related machinery."""
22

3+
import textwrap
34
import unittest
45
from unittest.mock import patch
5-
from test import shadowed_super
6+
from test.support import import_helper
67

78

89
ADAPTIVE_WARMUP_DELAY = 2
@@ -342,7 +343,20 @@ def test_super_argtype(self):
342343
super(1, int)
343344

344345
def test_shadowed_global(self):
346+
source = textwrap.dedent(
347+
"""
348+
class super:
349+
msg = "truly super"
350+
351+
class C:
352+
def method(self):
353+
return super().msg
354+
""",
355+
)
356+
with import_helper.ready_to_import(name="shadowed_super", source=source):
357+
import shadowed_super
345358
self.assertEqual(shadowed_super.C().method(), "truly super")
359+
import_helper.unload("shadowed_super")
346360

347361
def test_shadowed_local(self):
348362
class super:

0 commit comments

Comments
 (0)