[TIP] Guidelines for where to put tests & how to package them
olemis at gmail.com
Thu Feb 25 08:57:34 PST 2010
On Thu, Feb 25, 2010 at 11:48 AM, Olemis Lang <olemis at gmail.com> wrote:
> On Thu, Feb 25, 2010 at 11:22 AM, C. Titus Brown <ctb at msu.edu> wrote:
>> On Thu, Feb 25, 2010 at 09:56:30AM -0500, Olemis Lang wrote:
>>> On Thu, Feb 25, 2010 at 12:01 AM, C. Titus Brown <ctb at msu.edu> wrote:
>>> > Comments?
>>> It's great for the start, but I prefer `python setup.py test -m
>>> somepackage.test.run` (not sure about `test.run` yet ...) for testing
>>> everything in there, because it's more explicit, promotes a well known
>>> set of command line arguments and relieson distutils commands (and you
>>> can see by just looking at the command line ;o), so the command can
>>> perform a build or take whatever action it needs in order to satisfy
>>> the preconditions needed to run tests (e.g. installing ). Sometimes
>>> it's also useful to test just a well-known subset of what's been done
>>> (e.g. GViz QL Python client library that's implemented inside TracGviz
>>> plugin ;o) . In that case using -s or similar is useful.
>> Hmm, I'm just going to have to call "WTF" on you here:
> No problem ;o)
>> python setup.py test -m somepackage.test ...
>> This has several problems, now that I've retroactively defined my
>> conditions -- see my response to Robert. The problems:
>> - requires distutils extension for 'test' command
> Nope, that could be specified or overriden in `setup.py` using
> `cmdclass` keyword arg,
For instance, please take a look at Google's `gviz_api` setup.py script
>> - is potentially redundant or at least contains unnecessary information
>> ('test, plus, run this')
> Besides the short version could be `python setup.py test ` if
> `test_suite` or `test_module` is specified explicitly in the test
> script ;o)
>> So -1 on this from me!
> so, still -1 ? ...
IOW we both are talking about the same thing, but the snippet I
provided was the (explicit | long) version whereas yours was the
CMIIW anyway ;o)
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Adding handling of uncaught exceptions from protocols. -
More information about the testing-in-python