Add --continue-on-collection-errors option to restore the previous behaviour:
Execute tests (that were successfully collected) even when collection errors
happen.
Some tests had to be modified e.g. because the return code changed to 2
(EXIT_INTERRUPTED) instead of 1 (EXIT_TESTSFAILED) because an Interrupted
exception is raised on collection error.
Implemented via pair programming with:
Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>
closes#1421
This should prevent errors from pyenv:
pyenv: python2.6: command not found
The `python2.6' command exists in these Python versions:
2.6.9
While the pyenv wrapper explicitly returns 127, I think it is better to
just check for non-zero?!
The inner function and the explanatory comment it makes necessary can
all be removed if we switch to an if/else rather than try/except for
this condition.
Perhaps this bit comes from my fondness for C, but I think I would
find this style clearer and easier to understand even if it weren't
for the Python 2 quirk that makes the other style require us to add an
unnecessary-looking function abstraction. In any case, given that the
alternative does require that abstraction this is definitely simpler.
This appears to have been unused since commit
320835d "split out pytest-xdist related reporting to the plugin"
in July 2010. It's the only caller outside of _pytest/runner.py
of the `call_and_report` helper function there, so cutting it out
makes that more of a pure helper function and makes it slightly
easier to understand the code in _pytest/runner.py .
When the method argument is missing on teardown_method, the traceback is
100% internal to pytest, which with default options get pruned. Then
that traceback is empty, leading to a new exception as a traceback shall
not be empty.
This PR fixes that issue by pushing back the last stack on the
traceback, when the stacktrace is empty after pruning. Then the output
is still pruned, but gives meaningful information with the item where it
failed on the stack.
* fixes issue #1604
Signed-off-by: Guyzmo <guyzmo+github@m0g.net>