Skip to content

Pytest collection error is detected as interrupt #6

@BenjaminHamon

Description

@BenjaminHamon

When an error occurs during pytest collecting the tests (for example, a syntax error), pytest exits with the code 2. As per pytest documentation, this exit code is supposed to mean that the test execution was interrupted by the user. The issue was reported here: pytest-dev/pytest#4603.

The current implementation of the pytest runner is to raise an KeyboardInterrupt when the pytest process exits with the code 2, which hides the real issue. Since the pytest issue has been there for a long time, we probably should change the pytest runner behavior so that it checks if a collection error occurred and to raise an exception which will make sense to the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions