Skip to content
Merged
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: 3 additions & 0 deletions autograder/models/config/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ class TestConfig(BaseModel):
parameters: Optional[List[ParameterConfig]] = Field(
None, description="Named parameters for the test function"
)
weight: Optional[float] = Field(100.0, ge=0, description="Weight of this test")


Comment on lines 21 to 26
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The new weight field is part of the public config surface but there are no unit tests asserting its default (100.0) and validation (reject negative values). Please extend the existing config model tests (e.g., tests/unit/test_config_models.py) to cover these behaviors so regressions are caught.

Copilot uses AI. Check for mistakes.
model_config = {"extra": "forbid"}


def get_args_list(self) -> List[Any]:
"""Convert named parameters to positional arguments list."""
if not self.parameters:
Expand Down
3 changes: 3 additions & 0 deletions autograder/services/criteria_tree_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ def __parse_test(self, config: TestConfig) -> TestNode:
test_function,
config.get_kwargs_dict() or {},
file_target,
config.weight if config.weight is not None else 100.0,
)



return test

def __parse_category(self, category_name, config: CategoryConfig) -> CategoryNode:
Expand Down
2 changes: 2 additions & 0 deletions autograder/services/grader_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ def process_test(
score=test_result.score,
report=test_result.report,
parameters=test_result.parameters,
weight=test.weight,
)


def get_file_target(
self,
test_node: TestNode,
Expand Down
Loading