Hi everyone,

I have setup a continuous integration server (hudson) for Shapely: 
http://dev.mapproxy.org:8080/job/shapely/
It runs the Shapely tests with Python 2.5, 2.6 and 2.7 and each with GEOS 3.1.0 
(Ubuntu default), 3.1.1 and 3.2.2 (both set with LD_LIBRARY_PATH). It works 
pretty well except for the doctests with Python 2.7.

I like doctest, they are a good way to document an API and it is easy to 
produce 'testable' documentation. But they have limitations. First, they only 
check against strings which does not work reliable when the formatting changes. 
Best example here are floating point numbers in different Python versions. 
Second, they are not flexible enough. I had to rewrite linear-referencing.txt 
to a unittest.TestCase, because it is not possible to skip a doctest (the 
tested methods in that file are only available since 3.2).

I would volunteer to convert the other doctests to unittest.TestCases, if 
nobody objects. That way all tests should also run on 2.7. The doctests are 
nice to read, but since Sean provided a great manual for Shapely, it wouldn't 
be a great loss.

Another point I'd love to change is the test-runner. The Python unittest 
framework requires manual building of the test suites and this is error prone. 
I use nosetests[0] for some projects and it is really great. It has 
auto-discovery of all tests (even unittest.TestCase), test generators[1] and a 
large list of plugins (like code coverage or XML output for hudson). What do 
you think? Are there any reasons to keep unittest? Has anyone good/bad 
experience with nosetests?

[0] http://somethingaboutorange.com/mrl/projects/nose/0.11.2/testing.html
[1] 
http://somethingaboutorange.com/mrl/projects/nose/0.11.2/writing_tests.html#test-generators


Regards,
Oliver

_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to