Skip to content

Running with --pdb causes import failure #1810

Closed
@r-owen

Description

@r-owen

I'm running py.test with --pdb and when something goes wrong I get an unwanted failure here:

from doctest import UnexpectedException

in _pytest/pdb.py which is done only executed after the problem has been detected. The problem is that the error that is triggering pdb is running out of file handles, and that apparently makes the import fail.

I suggest moving that import to near the top of the file, with other imports, so UnexpectedException is guaranteed to be available.

I suspect this will be hard to unit test, since you'll have to explicitly run out of file handles.

This is using Python 2.7 on OS X 10.11 with pytest 2.9.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wanteddevelopers would like help from experts on this topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions