Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion hatch_build/tests/test_cli_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ def test_get_arg_from_model(self):
"z",
"--submodel-dict-instanced.a.sub-arg",
"500",
# p2a warns about a field it cannot expose when an argument for it is passed
"--unsupported-submodel-list.0.sub-arg=1",
"--unsupported-submodel-dict.a.sub-arg=1",
"--unsupported-literal=x",
"--unsupported-dict=a=b",
"--unsupported-dict-mixed-types=a=b",
"--unsupported-random-type=x",
],
),
patch("sys.stderr", new_callable=StringIO) as mock_stderr,
Expand All @@ -139,7 +146,7 @@ def test_get_arg_from_model(self):
assert hatchling() == 0
model, extras = parse_extra_args_model(MyTopLevelModel(submodel=SubModel()))

assert len(extras) == 1
assert len(extras) == 7
assert "--extra-arg-not-in-parser" in extras

assert model.extra_arg is True
Expand Down