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

Appearance settings

Commit afc7551

Browse filesBrowse files
sobolevnmiss-islington
authored andcommitted
pythongh-108303: Remove Lib/test/shadowed_super.py (pythonGH-114372)
Move code into Lib/test/test_super.py. (cherry picked from commit 2ef520e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 58fdd15 commit afc7551
Copy full SHA for afc7551

File tree

Expand file treeCollapse file tree

2 files changed

+15
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-8
lines changed

‎Lib/test/shadowed_super.py

Copy file name to clipboardExpand all lines: Lib/test/shadowed_super.py
-7Lines changed: 0 additions & 7 deletions
This file was deleted.

‎Lib/test/test_super.py

Copy file name to clipboardExpand all lines: Lib/test/test_super.py
+15-1Lines changed: 15 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.