Skip to content

markus_marks_earned overridden when earned marks == total marks and a test fails #7762

@sophia-huynh

Description

@sophia-huynh

For the pytest.mark.markus_marks_earned marker: if the marks earned matches the total marks but there's an error, then the error/failed status seems to take priority over the marks earned.

The example below generates 3 tests with various marks earned (0, 1, and 2) - the results for 0 and 1 will appear correctly on MarkUs, but 0/2 marks will be earned for the case where 2 should be earned.

import pytest


@pytest.mark.parametrize('marks_earned', [0, 1, 2])
def test_partial_marks(request, marks_earned: int) -> None:
    request.node.add_marker(pytest.mark.markus_marks_total(2))

    request.node.add_marker(pytest.mark.markus_marks_earned(marks_earned))

    assert False, f"Should be {marks_earned}/2"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions