testing (was spambayes plugin, and other plugins)
will <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
In the spec you state that we would consider switching to unittest...
That's the first I've heard of that. I skimmed the mailing lists to see
if we'd talked about this before, but I didn't see anything.
I picked nose (ha!) at the time after a cursory glance at the Python
testing world. Since then, I'm pretty sure I'd like to stick with it.
It's well regarded on the testing-in-python mailing list, it supports
extensions which make it more useful and I've been able to throw it
together pretty quickly without a lot of hassle. Adding tests is also
trivial.
So... I think I'd be -1 on switching from nose to unittest at this point.
Starting in January, Colin blogged about rewriting unittest:
http://oakwinter.com/code/pythons-unittest-module-sucks/
http://oakwinter.com/code/a-new-unittest/
http://oakwinter.com/code/motivation-for-rewriting-unittest/
There was some talk about it on the tip list. I think if that caught
on, I'd be interested in evaluating it as a possible testing framework
to use.
Anyone else have any thoughts on the current state of testing and
whether we should switch to unittest?
/will
Ryan Barrett wrote:
> On Thu, 6 Dec 2007, will wrote:
>
>> Adding some unit test related tasks is a good idea. I'll do that in the
>> next round. Some of the other projects have had tasks along the lines
>> of "improve test coverage to xyz percent." That'd help a lot.
>
> cool, makes sense. i've also written a first pass at a unit testing wiki page
> for 2.0:
>
> http://pyblosxom.sourceforge.net/wiki/index.php/Tests
>
> for convenience, here's the full text:
>
> ==
>
> Contents
> * 1 Tests
> * 2 Motivation
> * 3 State of the Union
> * 4 Framework
> * 5 Unit vs. Functional vs. Regression
> * 6 Discussion
>
> Tests
>
> Author: User:Ryan Ryan Barrett
>
> Originally published: December 6, 2007
>
>
> Motivation
>
> Unit testing has been strongly praised as a software development practice, and has become widely adopted in both industry and open source.
>
> When a project has a comprehensive set of tests, developers are less likely to break existing code inadvertently. This usually results in more contributions, fewer bugs, and higher confidence. (We've documented these trend in a number of projects at Google by measuring the number and quality of contributions before, during, and after they had full test suites.)
>
>
> State of the Union
>
> PyBlosxom currently has unit and functional tests for a few of its modules in the pyblosxom/test directory:
>
> unit/test_tools.py
> unit/test_callbacks.py
> unit/test_pathinfo.py
> functional/test_blog.py
>
> This is nowhere near complete, though. Also, none of the plugins in the contrib pack have unit tests. We need to write more tests!
>
>
> Framework
>
> The tests currently use the nose test framework. The unit tests all follow the pattern of one class per test case, with _setup() and _teardown() methods. The functional test follows a different pattern, with top-level setupblog(), cleanupblog(), and test_harness() methods.
>
> To run the tests, run:
>
> nosetests --verbose --include unit
> nosetests --verbose --include functional
>
> The Python unittest module is much more common and widely adopted than nose. We could consider switching to that at some point.
> Unit vs. Functional vs. Regression
>
> TODO(will): If you think it's worth addressing, consider filling in this section. Otherwise, we can delete it.
>
>
> Discussion
>
> Discussion of this proposal is at:
>
> gmane.org
> http://article.gmane.org/gmane.comp.web.pyblosxom.devel/1981
> sf.net
> http://sourceforge.net/mailarchive/forum.php?forum_name=pyblosxom-devel
>
> Retrieved from "http://pyblosxom.sourceforge.net/wiki/index.php/Tests"
>
> Category: 2.0 Planning
>
> -Ryan
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php