@@ -59,7 +59,7 @@ def check_type(
59
59
"We were expecting to receive a list of objects of the "
60
60
"following types: "
61
61
f"{ ", " .join ([repr (t .__name__ ) for t in acceptable_types ])} "
62
- f"{ " or \" None\" " if optional else "" } ; instead we received "
62
+ f"{ " or ' None' " if optional else "" } ; instead we received "
63
63
f"{ obj } which is a { repr (type (obj ).__name__ )} ."
64
64
)
65
65
raise TypeError (error_message )
@@ -70,7 +70,7 @@ def check_type(
70
70
"We were expecting to receive an object of one of the "
71
71
"following types: "
72
72
f"{ ", " .join (repr (t .__name__ ) for t in acceptable_types )} "
73
- f"{ " or \" None\" " if optional else "" } ; instead we "
73
+ f"{ " or ' None' " if optional else "" } ; instead we "
74
74
f"received { o } which is a { repr (type (o ).__name__ )} ."
75
75
)
76
76
raise TypeError (error_message )
@@ -82,7 +82,7 @@ def check_type(
82
82
error_message = (
83
83
"We were expecting to receive an instance of one of the following "
84
84
f"types: { ", " .join (repr (t .__name__ ) for t in acceptable_types )} "
85
- f"{ " or \" None\" " if optional else "" } ; but instead we received "
85
+ f"{ " or ' None' " if optional else "" } ; but instead we received "
86
86
f"{ obj } which is a { repr (type (obj ).__name__ )} ."
87
87
)
88
88
@@ -140,7 +140,8 @@ def validate_input(
140
140
# Check if the value is in the tuple of allowed values
141
141
if value_to_check not in allowed_values :
142
142
raise ValueError (
143
- f"Invalid value: { input_value } . Must be one of { expected_values } ."
143
+ f"Invalid value: \" { input_value } \" . "
144
+ f"Must be one of { expected_values } ."
144
145
)
145
146
146
147
return
@@ -178,13 +179,13 @@ def validate_dict_str(
178
179
for key , value in input_value .items ():
179
180
if not isinstance (key , key_type ):
180
181
errors .append (
181
- f"Key \" { key } \" of type { type (key ).__name__ } "
182
- f"is not of type { key_type .__name__ } ."
182
+ f"Key \" { key } \" of type \" { type (key ).__name__ } \" "
183
+ f"is not of type \" { key_type .__name__ } \" ."
183
184
)
184
185
if not isinstance (value , value_type ):
185
186
errors .append (
186
- f"Value \" { value } \" of type { type (value ).__name__ } "
187
- f"is not of type { value_type .__name__ } ."
187
+ f"Value \" { value } \" of type \" { type (value ).__name__ } \" "
188
+ f"is not of type \" { value_type .__name__ } \" ."
188
189
)
189
190
190
191
if errors :
0 commit comments