File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ def test_named_tuples(self):
178178 obj = Point (x = 11 )
179179 result = DeepHashPrep (obj , ignore_string_type_changes = True )
180180 if pypy3 :
181- assert result [get_id ( obj ) ] == "ntPoint:{%s:int:11}" % x
181+ assert result [obj ] == "ntPoint:{%s:int:11}" % x
182182 else :
183183 expected_result = {
184184 x : x_prep ,
@@ -197,21 +197,9 @@ class MyEnum(Enum):
197197 # the ids of strings change
198198 if pypy3 :
199199 # only compare the hashes for the enum instances themselves
200- assert DeepHashPrep (MyEnum .A )[get_id (MyEnum .A )] == (
201- 'objdict:{'
202- '__objclass__:EnumMeta:objdict:{_name_:B;_value_:int:2};'
203- '_name_:A;_value_:int:1}'
204- )
205- assert DeepHashPrep (MyEnum .B )[get_id (MyEnum .B )] == (
206- 'objdict:{'
207- '__objclass__:EnumMeta:objdict:{_name_:A;_value_:int:1};'
208- '_name_:B;_value_:int:2}'
209- )
210- assert DeepHashPrep (MyEnum (1 ))[get_id (MyEnum .A )] == (
211- 'objdict:{'
212- '__objclass__:EnumMeta:objdict:{_name_:B;_value_:int:2};'
213- '_name_:A;_value_:int:1}'
214- )
200+ assert DeepHashPrep (MyEnum .A )[MyEnum .A ] == r'objMyEnum:{str:__objclass__:EnumMeta:objMyEnum:{str:_name_:str:B;str:_value_:int:2};str:_name_:str:A;str:_value_:int:1}'
201+ assert DeepHashPrep (MyEnum .B )[MyEnum .B ] == r'objMyEnum:{str:__objclass__:EnumMeta:objMyEnum:{str:_name_:str:A;str:_value_:int:1};str:_name_:str:B;str:_value_:int:2}'
202+ assert DeepHashPrep (MyEnum (1 ))[MyEnum .A ] == r'objMyEnum:{str:__objclass__:EnumMeta:objMyEnum:{str:_name_:str:B;str:_value_:int:2};str:_name_:str:A;str:_value_:int:1}'
215203 else :
216204 assert DeepHashPrep (MyEnum .A ) == DeepHashPrep (MyEnum .A )
217205 assert DeepHashPrep (MyEnum .A ) == DeepHashPrep (MyEnum (1 ))
You can’t perform that action at this time.
0 commit comments