https://github.com/python/cpython/commit/2ef520ebecf5544ba792266a5dbe4d53653a4a03
commit: 2ef520ebecf5544ba792266a5dbe4d53653a4a03
branch: main
author: Nikita Sobolev <[email protected]>
committer: vstinner <[email protected]>
date: 2024-01-22T16:09:10+01:00
summary:
gh-108303: Remove `Lib/test/shadowed_super.py` (#114372)
Move code into Lib/test/test_super.py.
files:
D Lib/test/shadowed_super.py
M Lib/test/test_super.py
diff --git a/Lib/test/shadowed_super.py b/Lib/test/shadowed_super.py
deleted file mode 100644
index 2a62f667e93818..00000000000000
--- a/Lib/test/shadowed_super.py
+++ /dev/null
@@ -1,7 +0,0 @@
-class super:
- msg = "truly super"
-
-
-class C:
- def method(self):
- return super().msg
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py
index f8e968b9b56f82..256b416caaa584 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -1,8 +1,9 @@
"""Unit tests for zero-argument super() & related machinery."""
+import textwrap
import unittest
from unittest.mock import patch
-from test import shadowed_super
+from test.support import import_helper
ADAPTIVE_WARMUP_DELAY = 2
@@ -342,7 +343,20 @@ def test_super_argtype(self):
super(1, int)
def test_shadowed_global(self):
+ source = textwrap.dedent(
+ """
+ class super:
+ msg = "truly super"
+
+ class C:
+ def method(self):
+ return super().msg
+ """,
+ )
+ with import_helper.ready_to_import(name="shadowed_super",
source=source):
+ import shadowed_super
self.assertEqual(shadowed_super.C().method(), "truly super")
+ import_helper.unload("shadowed_super")
def test_shadowed_local(self):
class super:
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]