File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11"""Unit tests for zero-argument super() & related machinery."""
22
3+ import textwrap
34import unittest
45from unittest .mock import patch
5- from test import shadowed_super
6+ from test . support import import_helper
67
78
89ADAPTIVE_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 :
You can’t perform that action at this time.
0 commit comments