DocTests as TestCase methods/attrs, need PR reviewer.
Lately, I've been using nose and the support in nose for doctests makes me weep. When I integrated doctests with unittest, I based the integration on test suites, but nose ignores test suites. Today, I created a small module in zope.testing that let's you define doctest in ordinary TestCase classes that nose sees. Another advantage of this approach is that doctest defined this way use the same fixture mechanism that ordinary unit tests do. Some simple examples can be seen here: https://github.com/zopefoundation/zope.testing/blob/doctestcase/src/zope/tes... I'd love it if someone would review my PR. :) https://github.com/zopefoundation/zope.testing/pull/4 Jim -- Jim Fulton http://jimfulton.info
On 7/13/15 1:57 AM, Jim Fulton wrote:
I'd love it if someone would review my PR. :)
https://github.com/zopefoundation/zope.testing/pull/4
Jim
Once again Jim has improved the state of Python development. There used to be two separate testing mechanisms. Doctests and Unittests. They are now integrated, making them both easier to use. For those who are not familiar with the terminology. Doctests are based on the text strings defined in a method. https://en.wikipedia.org/wiki/Doctest Unit Tests test a tiny piece of code. https://en.wikipedia.org/wiki/Unit_testing Integrating the two different testing systems makes life so much easier for developers. Hope that helps! Chris
participants (2)
-
Christopher Lozinski -
Jim Fulton