CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
792 stars 75 forks source link

report unhandled exception in testing framework #61

Closed e3krisztian closed 9 years ago

e3krisztian commented 9 years ago

Fixes #60 - uncaught exception from testcase - exit without traceback

e3krisztian commented 9 years ago

I have seen g, but did not know what it is for, installed green in two separate virtualenvs, e2 for python2 and e3 for python3:

for v in 2 3
do
    virtualenv$v e$v
    . e$v/bin/activate
    # -e . "installs" current directory as "editable" package - future edits will be immediately available
    pip install -e .
    pip install mock pytest testtools coverage
    deactivate
done

then I could run e2/bin/green and e3/bin/green

e3krisztian commented 9 years ago

Multiprocessing is a great feature with current machines!

This PR is too simple to work in a multiprocessing runner. When I saw the code I was modifying it was obvious that more work would be required, like using the stream object for color output or passing the info back to the parent runner and also a test against regression.

CleanCut commented 9 years ago

Okay, I went quite a bit deeper into the code and handled stuff in the poolRunner function. I think this solves your problem in a similar way to what you were proposing, and also goes well with the worker initializer/finalizer work I'm working on in a different branch.

If you want to try it out yourself right now, it's in this branch: https://github.com/CleanCut/green/tree/catch-unhandled-exceptions

Otherwise, you will be able to try it out when I release version 1.10.0, hopefully tomorrow sometime.

e3krisztian commented 9 years ago

The exception handling looks fine to me! :)

Some thoughts after reading the code:

CleanCut commented 9 years ago

(I wish github had a "quote" feature).

I created #62 to make sure I don't forget.