File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,10 @@ def test_outputBinding(cwl_v1_2_schema: SchemaType) -> None:
6767
6868def test_yaml_tab_error (cwl_v1_2_schema : SchemaType ) -> None :
6969 """Tabs in the file."""
70+ res : Any = ""
7071 with pytest .raises (
7172 ValidationException ,
7273 match = r".+found\s+character\s+'\\t'\s+that\s+cannot\s+start\s+any\s+token$" ,
7374 ):
7475 res = load_cwl (cwl_v1_2_schema , src = "test_real_cwl/tabs_rna_seq_workflow.cwl" )
75- print (res )
76+ print (res )
Original file line number Diff line number Diff line change @@ -132,12 +132,12 @@ def test_error_message5() -> None:
132132
133133 t = "test_schema/test5.cwl"
134134 match = r"""
135- ^.+test5\.cwl:2:1: Object\s+'.+test5\.cwl'\s+is\s+not valid because
136- \s+tried 'Workflow'\s+but
137- .+test5\.cwl:7:1: the 'steps'\s+field\s+is\s+not\s+valid\s+because
138- \s+tried array\s+of\s+<WorkflowStep>\s+but
139- .+test5\.cwl:7:9: item is\s+invalid\s+because
140- \s+is not a\s+dict$""" [
135+ ^.+test5\.cwl:2:1: Object\s+'.+test5\.cwl'\s+is\s+not\s+ valid\s+ because
136+ \s+tried\s+ 'Workflow'\s+but
137+ .+test5\.cwl:7:1: the\s+ 'steps'\s+field\s+is\s+not\s+valid\s+because
138+ \s+tried\s+ array\s+of\s+<WorkflowStep>\s+but
139+ .+test5\.cwl:7:9: item\s+ is\s+invalid\s+because
140+ \s+is\s+ not\s+ a\s+dict.\s+Expected\s+a\s+WorkflowStep\s+object. $""" [
141141 1 :
142142 ]
143143 with pytest .raises (ValidationException , match = match ):
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def validate_ex(
196196 raise ValidationException (
197197 "the value {} is not a valid {}, expected {}{}" .format (
198198 vpformat (datum ),
199- expected_schema .name ,
199+ friendly ( expected_schema .name ) ,
200200 "one of " if len (expected_schema .symbols ) > 1 else "" ,
201201 "'" + "', '" .join (expected_schema .symbols ) + "'" ,
202202 )
@@ -299,7 +299,9 @@ def validate_ex(
299299 if isinstance (expected_schema , avro .schema .RecordSchema ):
300300 if not isinstance (datum , MutableMapping ):
301301 if raise_ex :
302- raise ValidationException ("is not a dict" )
302+ raise ValidationException (
303+ f"is not a dict. Expected a { friendly (expected_schema .name )} object."
304+ )
303305 return False
304306
305307 classmatch = None
You can’t perform that action at this time.
0 commit comments