Closed charles-l closed 4 years ago
Oh, interesting -- it looks like the bug is actually in the GreenTestLoader class. When I run poolRunner('test_doctest', ...)
(so it imports it directly without wrapping in the GreenTestLoader), the tests run as expected. I'll try and dig into that issue and see if I can't fix it...
Fascinating! Testing for the win... 😉 I'm excited to hear what you find.
Fun fact: I started looking into this and ended up almost adding doctest support to green. I've just got a final issue that I'm stuck on that is driving me crazy.
Got doctest support working! I want to finish writing up some new tests for it (naturally), and then I'll put together a new release.
Edit: Unfortunately, I found another showstopper bug while writing tests. I'm stuck again. 😢
Update: Fixed that one too! (Don't do from doctest import DocTestCase
in a test module, because DocTestCase
is a subclass of TestCase
and gets caught up in unittest test discovery.
Support for doctests was added in version 3.1.0, just released.
Oh sweet -- thanks for adding this support! I'm excited to start using it :)
Let me know how it goes!
green
currently hangs when trying to run with a doctests in the load_tests call:(save the following to a file named
test_doctest.py
):This patch catches the exception that's thrown in the worker and reports it back. Before, the workers would bail and become defunct processes, while the scheduler process would hang because it was waiting for a result from the queue (which never showed up)
This doesn't fix the underlying issue with doctest (unfortunately), but it at least prints the error and prevents
green
from hanging.