Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Running with --pdb causes import failure #1810
I'm running py.test with --pdb and when something goes wrong I get an unwanted failure here:
I suggest moving that import to near the top of the file, with other imports, so
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
@RonnyPfannschmidt when moving the import in debugging.py to the top of the file, the python3 tests fail during test_logging_initialized_in_test in test_capture.py.
The full assertion error report can be found here: https://bpaste.net/show/d0e649b5c7bd
Looks like the test fails due to fnmatch not finding a match for hello432.
I'm not sure how the import and this test relate, any advice would be appreciated.
So I guess moving
@r-owen if you are running out of file-handles, I'm guessing you will fail sometime soon anyway so just moving doctest to the top probably won't fix your problem.
One alternative would be to protect that import:
try: from doctest import UnexpectedException except: UnexpectedException = RuntimeError
then at least we could properly throw something even if the type of the exception is wrong. I don't know if there is code higher up that is trying to catch