@@ -1940,13 +1940,12 @@ class A(Generic[T]):
1940
1940
self .assertNotEqual (typing .FrozenSet [A [str ]],
1941
1941
typing .FrozenSet [mod_generics_cache .B .A [str ]])
1942
1942
1943
- if sys .version_info [:2 ] > (3 , 2 ):
1944
- self .assertTrue (repr (Tuple [A [str ]]).endswith ('<locals>.A[str]]' ))
1945
- self .assertTrue (repr (Tuple [B .A [str ]]).endswith ('<locals>.B.A[str]]' ))
1946
- self .assertTrue (repr (Tuple [mod_generics_cache .A [str ]])
1947
- .endswith ('mod_generics_cache.A[str]]' ))
1948
- self .assertTrue (repr (Tuple [mod_generics_cache .B .A [str ]])
1949
- .endswith ('mod_generics_cache.B.A[str]]' ))
1943
+ self .assertTrue (repr (Tuple [A [str ]]).endswith ('<locals>.A[str]]' ))
1944
+ self .assertTrue (repr (Tuple [B .A [str ]]).endswith ('<locals>.B.A[str]]' ))
1945
+ self .assertTrue (repr (Tuple [mod_generics_cache .A [str ]])
1946
+ .endswith ('mod_generics_cache.A[str]]' ))
1947
+ self .assertTrue (repr (Tuple [mod_generics_cache .B .A [str ]])
1948
+ .endswith ('mod_generics_cache.B.A[str]]' ))
1950
1949
1951
1950
def test_extended_generic_rules_eq (self ):
1952
1951
T = TypeVar ('T' )
@@ -2065,11 +2064,9 @@ class MyDict(typing.Dict[T, T]): ...
2065
2064
class MyDef (typing .DefaultDict [str , T ]): ...
2066
2065
self .assertIs (MyDef [int ]().__class__ , MyDef )
2067
2066
self .assertEqual (MyDef [int ]().__orig_class__ , MyDef [int ])
2068
- # ChainMap was added in 3.3
2069
- if sys .version_info >= (3 , 3 ):
2070
- class MyChain (typing .ChainMap [str , T ]): ...
2071
- self .assertIs (MyChain [int ]().__class__ , MyChain )
2072
- self .assertEqual (MyChain [int ]().__orig_class__ , MyChain [int ])
2067
+ class MyChain (typing .ChainMap [str , T ]): ...
2068
+ self .assertIs (MyChain [int ]().__class__ , MyChain )
2069
+ self .assertEqual (MyChain [int ]().__orig_class__ , MyChain [int ])
2073
2070
2074
2071
def test_all_repr_eq_any (self ):
2075
2072
objs = (getattr (typing , el ) for el in typing .__all__ )
@@ -4096,14 +4093,6 @@ def test_basics(self):
4096
4093
self .assertEqual (Emp .__annotations__ ,
4097
4094
collections .OrderedDict ([('name' , str ), ('id' , int )]))
4098
4095
4099
- def test_namedtuple_pyversion (self ):
4100
- if sys .version_info [:2 ] < (3 , 6 ):
4101
- with self .assertRaises (TypeError ):
4102
- NamedTuple ('Name' , one = int , other = str )
4103
- with self .assertRaises (TypeError ):
4104
- class NotYet (NamedTuple ):
4105
- whatever = 0
4106
-
4107
4096
def test_annotation_usage (self ):
4108
4097
tim = CoolEmployee ('Tim' , 9000 )
4109
4098
self .assertIsInstance (tim , CoolEmployee )
0 commit comments