[Distutils] Problem with distribute and converting tests for python3

Lennart Regebro regebro at gmail.com
Mon Oct 12 06:24:49 CEST 2009


2009/10/11 Michael Whapples <mwhapples at aim.com>:
> My problem with having unit tests included in a binary distribution is that
> they take up space and have no way to be run, so can certainly be called a
> waste of space. OK, may be they could be run by a user importing the correct
> modules, etc, I meant no simple way (eg. as done in a source package with
> the command
> $ setup.py test

True, you need some test runner like nose or zope.tetsing or so. But
then it works.

> ). Also anyway what would the reason be for a user to run tests on the
> binary module, I (or another developer in the cases of modified versions)
> should have run the tests before distributing the binary package.

Yes, but if something breaks it can be good to run the tests locally
to see if something in the environments breaks them. Also tests can be
useful as a sort of documentation.

> OK, to possible solutions:
> 1. Distribute offers the keyword argument "convert_2to3_doctests", may be it
> could have one to give test directory, and then .py files in that could be
> converted.

Well, the test directory is test/test*.py.

> 2. As setuptools automatically includes test/test*.py, why can't distribute
> actually compile these files as well (I question whether tests in a test
> directory should be prefixed with test, but I don't have a really strong
> view should people disagree).

The problem is that these files doesn't end up in the binary
distribution and hence 2to3 can't be run on them.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the Distutils-SIG mailing list