Skip to content

terminal collection summary wrong count if there is an error #9626

@schettino72

Description

@schettino72

Lets say I have a test module with content:

def test_one():
    pass
def test_two():
    pass
def test_three():
    pass

pytest -k test_ would should show:
collected 3 items / 1 deselected / 2 selected

But if there is another test module that raises an exception when imported: i.e.:

5/0
def test_foo():
    pass

The output for same command would be:
collected 3 items / 1 error / 1 deselected / 1 selected

Note how no new item was collected from the module raising an exception,
but the "selected" count substracted 1 due to the error on collecting the module.

The expected output would be:
collected 3 items / 1 error / 1 deselected / 2 selected

pytest version 7.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions