diff --git a/Changelog.md b/Changelog.md index 34481d1eaf..2c541a6dfd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -31,6 +31,7 @@ - Refactored the method of loading `javascripts/Results/keybinding.js` in `submission_selector.jsx` (#7566) - Updated the instructor table to use `@tanstack/react-table` v8 (#7589) - Refactor `DropDownMenu` class to a new React component (#7592) +- Updated Python autotest script file to include example of using `pytest.mark` to customize test marks (#7597) ## [v2.7.1] diff --git a/db/data/autotest_files/py/script_files/test2.py b/db/data/autotest_files/py/script_files/test2.py index f549df032d..4c84303af3 100644 --- a/db/data/autotest_files/py/script_files/test2.py +++ b/db/data/autotest_files/py/script_files/test2.py @@ -51,3 +51,15 @@ def test_with_markers(request): request.node.add_marker(pytest.mark.markus_overall_comments( "Here is some general feedback for this submission." )) + + +def test_with_partial_credit(request): + """This test gives the student a score of 1/2.""" + request.node.add_marker(pytest.mark.markus_marks_earned(0)) + request.node.add_marker(pytest.mark.markus_marks_total(2)) + + +def test_with_bonus(request): + """This test gives the student a score of 3/2.""" + request.node.add_marker(pytest.mark.markus_marks_earned(3)) + request.node.add_marker(pytest.mark.markus_marks_total(2))