File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 11"""Unit tests for new super() implementation."""
22
3+ from __future__ import absolute_import , division , unicode_literals
34import sys
45import unittest
5- from test import support
66
7+ from future .tests .base import unittest
8+ from future .builtins import super
79
8- class A :
10+
11+ class A (object ):
912 def f (self ):
1013 return 'A'
1114 @classmethod
@@ -94,22 +97,22 @@ def f(self):
9497
9598 def test___class___instancemethod (self ):
9699 # See issue #14857
97- class X :
100+ class X ( object ) :
98101 def f (self ):
99102 return __class__
100103 self .assertIs (X ().f (), X )
101104
102105 def test___class___classmethod (self ):
103106 # See issue #14857
104- class X :
107+ class X ( object ) :
105108 @classmethod
106109 def f (cls ):
107110 return __class__
108111 self .assertIs (X .f (), X )
109112
110113 def test___class___staticmethod (self ):
111114 # See issue #14857
112- class X :
115+ class X ( object ) :
113116 @staticmethod
114117 def f ():
115118 return __class__
@@ -123,15 +126,15 @@ def f(x):
123126 del x
124127 super ()
125128 self .assertRaises (RuntimeError , f , None )
126- class X :
129+ class X ( object ) :
127130 def f (x ):
128- nonlocal __class__
131+ # nonlocal __class__
129132 del __class__
130133 super ()
131134 self .assertRaises (RuntimeError , X ().f )
132135
133136 def test_cell_as_self (self ):
134- class X :
137+ class X ( object ) :
135138 def meth (self ):
136139 super ()
137140
@@ -144,9 +147,5 @@ def g():
144147 self .assertRaises (TypeError , X .meth , c )
145148
146149
147- def test_main ():
148- support .run_unittest (TestSuper )
149-
150-
151150if __name__ == "__main__" :
152151 unittest .main ()
You can’t perform that action at this time.
0 commit comments