Closed
Description
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