Skip to content

Exit without any error log when test fails during the collection #30

@guybowden

Description

@guybowden

Not sure if this is by design or a bug.. but it would be helpful to output the errors somehow if the test errors out during the test collection phase.

We recently were experiencing a test exiting when a test script was importing some code that relied on a database being there in order to execute. The import was at the top of the file and should have been inside a test method.

The output from the tap stream was:

1..0

Running the test without the --tap-stream argument showed what the error was:

-------- ERROR collecting tests.py -------- 
tests.py:16: in <module>
    from my_module import MyClass
...
E   ProgrammingError: relation “x” does not exist
E   LINE 1: ...ion”, “x”.“y” FROM “x...
E                                                                ^

!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions