@@ -181,12 +181,14 @@ class MyClass(ty.Generic[T]):
181
181
pass
182
182
183
183
obj_repr = join_bytes_repr (MyClass [int ])
184
- assert obj_repr == b"type:(pydra.utils.tests.test_hash.MyClass[type:(int)])"
184
+ assert (
185
+ obj_repr == b"type:(pydra.utils.tests.test_hash.MyClass[type:(builtins.int)])"
186
+ )
185
187
186
188
187
189
def test_bytes_special_form1 ():
188
190
obj_repr = join_bytes_repr (ty .Union [int , float ])
189
- assert re . match ( rb "type:\ (typing.Union\[.{32}\]\)" , obj_repr )
191
+ assert obj_repr == b "type:(typing.Union[type:(builtins.int)type:(builtins.float)])"
190
192
191
193
192
194
def test_bytes_special_form2 ():
@@ -196,20 +198,22 @@ def test_bytes_special_form2():
196
198
197
199
def test_bytes_special_form3 ():
198
200
obj_repr = join_bytes_repr (ty .Optional [Path ])
199
- assert re .match (rb"type:\(typing.Union\[.{32}\]\)" , obj_repr , flags = re .DOTALL )
201
+ assert (
202
+ obj_repr == b"type:(typing.Union[type:(pathlib.Path)type:(builtins.NoneType)])"
203
+ )
200
204
201
205
202
206
def test_bytes_special_form4 ():
203
207
obj_repr = join_bytes_repr (ty .Type [Path ])
204
- assert re . match ( rb "type:\ (builtins.type\[.{16}\]\)" , obj_repr , flags = re . DOTALL )
208
+ assert obj_repr == b "type:(builtins.type[type:(pathlib.Path)])"
205
209
206
210
207
211
def test_bytes_special_form5 ():
208
212
obj_repr = join_bytes_repr (ty .Callable [[Path , int ], ty .Tuple [float , str ]])
209
- assert re .match (
210
- rb"type:\(collections.abc.Callable\[.{32}\]\)" , obj_repr , flags = re .DOTALL
213
+ assert obj_repr == (
214
+ b"type:(collections.abc.Callable[[type:(pathlib.Path)type:(builtins.int)]"
215
+ b"type:(builtins.tuple[type:(builtins.float)type:(builtins.str)])])"
211
216
)
212
- assert obj_repr != join_bytes_repr (ty .Callable [[Path , int ], ty .Tuple [float , bytes ]])
213
217
214
218
215
219
def test_recursive_object ():
0 commit comments