Skip to content

Commit

Permalink
Skip union tests for Pydantic v1
Browse files Browse the repository at this point in the history
parse_obj_as does not appear to support union types (it is converting
ints to strings).

Signed-off-by: Alice Purcell <[email protected]>
  • Loading branch information
alicederyn committed Oct 15, 2024
1 parent 52437be commit 83eb2ee
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,23 @@
{},
id="no-type-dict",
),
pytest.param(
"tests.script_runner.parameter_inputs:str_or_int_parameter",
[{"name": "my_str_or_int", "value": "hi there"}],
"type given: str",
id="str-or-int-given-str",
),
pytest.param(
"tests.script_runner.parameter_inputs:str_or_int_parameter",
[{"name": "my_str_or_int", "value": "3"}],
"type given: int",
id="str-or-int-given-int",
*(
[
pytest.param(
"tests.script_runner.parameter_inputs:str_or_int_parameter",
[{"name": "my_str_or_int", "value": "hi there"}],
"type given: str",
id="str-or-int-given-str",
),
pytest.param(
"tests.script_runner.parameter_inputs:str_or_int_parameter",
[{"name": "my_str_or_int", "value": "3"}],
"type given: int",
id="str-or-int-given-int",
),
]
if _PYDANTIC_VERSION > 1
else []
),
pytest.param(
"tests.script_runner.parameter_inputs:str_parameter_expects_jsonstr_dict",
Expand Down

0 comments on commit 83eb2ee

Please sign in to comment.