@@ -294,7 +294,8 @@ def check_metadata(self):
294
294
# not allowing for default if the field is mandatory
295
295
if not fld .default == attr .NOTHING and mdata .get ("mandatory" ):
296
296
raise AttributeError (
297
- "default value should not be set when the field is mandatory"
297
+ f"default value ({ fld .default !r} ) should not be set when the field "
298
+ f"('{ fld .name } ') in { self } ) is mandatory"
298
299
)
299
300
# setting default if value not provided and default is available
300
301
if getattr (self , fld .name ) is None :
@@ -385,19 +386,19 @@ def check_metadata(self):
385
386
raise TypeError (
386
387
f"Type of '{ fld .name } ' should be either pathlib.Path or "
387
388
f"typing.Union[pathlib.Path, bool] (not { fld .type } ) because "
388
- f"it has a value for output_file_template ({ mdata ['output_file_template' ]} )"
389
+ f"it has a value for output_file_template ({ mdata ['output_file_template' ]!r } )"
389
390
)
390
391
if fld .default not in [attr .NOTHING , True , False ]:
391
392
raise AttributeError (
392
- f"default value ({ fld .default } ) should not be set together with "
393
- f"output_file_template ({ mdata ['output_file_template' ]} ) for "
393
+ f"default value ({ fld .default !r } ) should not be set together with "
394
+ f"output_file_template ({ mdata ['output_file_template' ]!r } ) for "
394
395
f"'{ fld .name } ' field in { self } "
395
396
)
396
397
# not allowing for default if the field is mandatory
397
398
if not fld .default == attr .NOTHING and mdata .get ("mandatory" ):
398
399
raise AttributeError (
399
- f"default value ({ fld .default } ) should not be set when the field "
400
- f"('{ fld .name } ' in { self } ) is mandatory"
400
+ f"default value ({ fld .default !r } ) should not be set when the field "
401
+ f"('{ fld .name } ') in { self } ) is mandatory"
401
402
)
402
403
# setting default if value not provided and default is available
403
404
if getattr (self , fld .name ) is None :
0 commit comments