[Python] In a pytest coverage report, what does "->" mean for missing lines?

Discussão em 'Python' iniciado por Stack, Agosto 5, 2025.

  1. Stack

    Stack Membro Participativo

    I'm running pytest with the coverage plugin (pytest --cov) and in the report I got the following line:

    Name Stmts Miss Branch BrPart Cover Missing
    ---------------------------------------------------------
    foo.py 5 1 2 1 71% 3->5, 5


    I know that 3-5 would mean it missed lines 3 to 5, but I don't know what -> means. From the test logic, I'd expect only 5 to be reported. For reference, this is the code I used:

    # foo.py

    class Test:
    def __lt__(self, other):
    if type(self) == type(other):
    return False
    return NotImplemented


    # test_foo.py

    def test_lt():
    test = Test()
    assert not (test < test)

    Continue reading...

Compartilhe esta Página