Making conftest import failures easier to debug
This commit is contained in:
parent
7927dff8a1
commit
61e605f60b
1
AUTHORS
1
AUTHORS
|
@ -59,6 +59,7 @@ Jaap Broekhuizen
|
||||||
Jan Balster
|
Jan Balster
|
||||||
Janne Vanhala
|
Janne Vanhala
|
||||||
Jason R. Coombs
|
Jason R. Coombs
|
||||||
|
Javier Domingo Cansino
|
||||||
John Towler
|
John Towler
|
||||||
Joshua Bronson
|
Joshua Bronson
|
||||||
Jurko Gospodnetić
|
Jurko Gospodnetić
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
level an error will be raised during collection.
|
level an error will be raised during collection.
|
||||||
Thanks `@omarkohl`_ for the complete PR (`#1519`_).
|
Thanks `@omarkohl`_ for the complete PR (`#1519`_).
|
||||||
|
|
||||||
*
|
* Fix (`1516`_): ConftestImportFailure now shows the traceback
|
||||||
|
|
||||||
**Incompatible changes**
|
**Incompatible changes**
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,12 @@ class ConftestImportFailure(Exception):
|
||||||
self.path = path
|
self.path = path
|
||||||
self.excinfo = excinfo
|
self.excinfo = excinfo
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
etype, evalue, etb = self.excinfo
|
||||||
|
formatted = traceback.format_tb(etb)
|
||||||
|
# The level of the tracebacks we want to print is hand crafted :(
|
||||||
|
return repr(evalue) + '\n' + ''.join(formatted[2:])
|
||||||
|
|
||||||
|
|
||||||
def main(args=None, plugins=None):
|
def main(args=None, plugins=None):
|
||||||
""" return exit code, after performing an in-process test run.
|
""" return exit code, after performing an in-process test run.
|
||||||
|
|
Loading…
Reference in New Issue