Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions pyrit/cli/frontend_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,6 @@ def parse_run_arguments(*, args_string: str) -> dict[str, Any]:
result["max_dataset_size"] = validate_integer(parts[i], name="--max-dataset-size", min_value=1)
i += 1
else:
logger.warning(f"Unknown argument: {parts[i]}")
i += 1
raise ValueError(f"Unknown argument: {parts[i]}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see where this is in code, but hoping this doesn't terminate the process, just re-type. If so that's ideal :)


return result
5 changes: 5 additions & 0 deletions tests/unit/cli/test_frontend_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@ def test_parse_run_arguments_missing_value(self):
with pytest.raises(ValueError, match="requires a value"):
frontend_core.parse_run_arguments(args_string="test_scenario --max-concurrency")

def test_parse_run_arguments_unknown_argument_raises(self):
"""Test parsing with an unknown argument fails fast."""
with pytest.raises(ValueError, match=r"Unknown argument: --bogus"):
frontend_core.parse_run_arguments(args_string="test_scenario --bogus 123 --max-retries 2")


@pytest.mark.asyncio
@pytest.mark.usefixtures("patch_central_database")
Expand Down
Loading