File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -207,20 +207,11 @@ class MyEnum(Enum):
207207 A = 1
208208 B = 2
209209
210- # checking if pypy3 is running the test
211- # in that case due to a difference of string interning implementation
212- # the ids of strings change
213- if pypy3 :
214- # only compare the hashes for the enum instances themselves
215- 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}'
216- 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}'
217- 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}'
218- else :
219- assert DeepHashPrep (MyEnum .A ) == DeepHashPrep (MyEnum .A )
220- assert DeepHashPrep (MyEnum .A ) == DeepHashPrep (MyEnum (1 ))
221- assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .A .name )
222- assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .A .value )
223- assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .B )
210+ assert DeepHashPrep (MyEnum .A )[MyEnum .A ] == r'objMyEnum:{str:_name_:str:A;str:_value_:int:1}'
211+ assert DeepHashPrep (MyEnum .A ) == DeepHashPrep (MyEnum (1 ))
212+ assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .A .name )
213+ assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .A .value )
214+ assert DeepHashPrep (MyEnum .A ) != DeepHashPrep (MyEnum .B )
224215
225216 def test_dict_hash (self ):
226217 string1 = "a"
You can’t perform that action at this time.
0 commit comments