File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ import pytest
2
+ import schema_salad .schema
3
+
4
+ @pytest .fixture (autouse = True , scope = 'function' )
5
+ def isolated_cache ():
6
+ """A fixture to clear the schema_salad metaschema cache.
7
+
8
+ Auto-loaded (see autouse) fixture, loaded per test (function scope).
9
+ Prevents issues when running multiple tests that load metaschemas
10
+ multiple times or in parallel (`pytest-parallel`, `pytest-xdist`, etc).
11
+ """
12
+ schema_salad .schema .cached_metaschema = None
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ def test_error_message2() -> None:
72
72
73
73
t = "test_schema/test2.cwl"
74
74
match = r"""
75
- ^.+test2\.cwl:2:1: Field `class`\s+contains\s+undefined\s+reference to
75
+ ^.+test2\.cwl:2:1: Field `class`\s+contains\s+undefined\s+reference\s+ to
76
76
\s+`file://.+/schema_salad/tests/test_schema/xWorkflow`$""" [
77
77
1 :
78
78
]
@@ -214,7 +214,7 @@ def test_error_message10() -> None:
214
214
215
215
t = "test_schema/test10.cwl"
216
216
match = r"""
217
- ^.+test10\.cwl:2:1: Object\s+`.+test10\.cwl`\s+is not valid because
217
+ ^.+test10\.cwl:2:1: Object\s+`.+test10\.cwl`\s+is\s+ not\s+ valid\s+ because
218
218
\s+tried `Workflow`\s+but
219
219
.+test10\.cwl:7:1: the `steps`\s+field\s+is\s+not\s+valid\s+because
220
220
\s+tried array\s+of\s+<WorkflowStep>\s+but
@@ -240,7 +240,7 @@ def test_error_message11() -> None:
240
240
match = r"""
241
241
^.+test11\.cwl:7:1: checking field\s+`steps`
242
242
.+test11\.cwl:8:3: checking object\s+`.+test11\.cwl#step1`
243
- .+test11\.cwl:9:5: Field `run`\s+contains\s+undefined\s+reference to
243
+ .+test11\.cwl:9:5: Field `run`\s+contains\s+undefined\s+reference\s+ to
244
244
\s+`file://.+/tests/test_schema/blub\.cwl`$""" [
245
245
1 :
246
246
]
You can’t perform that action at this time.
0 commit comments