[Twisted-Python] twisted.trial and test discovery
Maybe a dead horse, but there was some prior discussion on nose vs. trial in Feb: http://twistedmatrix.com/pipermail/twisted-python/2007-February/014771.html I like trial a lot (both for Twisted and non-Twisted applications - heck I've even tested [gasp] Java applications with it). The only somewhat interesting feature of nose (vs. trial) I've found is test discovery. Is test discovery a planned feature for trial? -- \\\\\/\"/\\\\\\\\\\\ \\\\/ // //\/\\\\\\\ \\\/ \\// /\ \/\\\\ \\/ /\/ / /\/ /\ \\\ \/ / /\/ /\ /\\\ \\ / /\\\ /\\\ \\\\\/\ \/\\\\\/\\\\\/\\\\\\ d.p.s
On 9/19/07, Drew Smathers <drew.smathers@gmail.com> wrote:
Maybe a dead horse, but there was some prior discussion on nose vs. trial in Feb:
http://twistedmatrix.com/pipermail/twisted-python/2007-February/014771.html
I like trial a lot (both for Twisted and non-Twisted applications - heck I've even tested [gasp] Java applications with it). The only somewhat interesting feature of nose (vs. trial) I've found is test discovery. Is test discovery a planned feature for trial?
I'm not sure I understand. Trial already does test discovery. "trial yourpackage" will find all the test cases in your package. jml
I'm not sure I understand. Trial already does test discovery. "trial yourpackage" will find all the test cases in your package.
Yes, I know. It will not pick up doctests defined in plain text files (mymod.txt - like you see frequently in zope projects) or in doc strings from my experiments. Of course, this is just me being lazy - especially for doctests inside of modules where I can make a trivial test_doc module to collect these: from myproject import web, auth, i18n __doctests__ = [ web, auth, i18n ] -- \\\\\/\"/\\\\\\\\\\\ \\\\/ // //\/\\\\\\\ \\\/ \\// /\ \/\\\\ \\/ /\/ / /\/ /\ \\\ \/ / /\/ /\ /\\\ \\ / /\\\ /\\\ \\\\\/\ \/\\\\\/\\\\\/\\\\\\ d.p.s
On 9/20/07, Drew Smathers <drew.smathers@gmail.com> wrote:
I'm not sure I understand. Trial already does test discovery. "trial yourpackage" will find all the test cases in your package.
Yes, I know. It will not pick up doctests defined in plain text files (mymod.txt - like you see frequently in zope projects) or in doc strings from my experiments. Of course, this is just me being lazy - especially for doctests inside of modules where I can make a trivial test_doc module to collect these:
from myproject import web, auth, i18n __doctests__ = [ web, auth, i18n ]
In this case, Trial follows the principle that "explicit is better than implicit". Rather than treating every random snippet of text as a potential doctest, it's reasonable that documents have be *declared* as executable. If you want to do something a little more automated than assigning things to __doctest__, Trial lets you hook into the test discovery system by defining a 'test_suite' method in your module. This allows you to customize your test discovery for your project. jml
participants (2)
-
Drew Smathers
-
Jonathan Lange