Tests not being convered by 2to3 in setup.py? Tests not being convered by 2to3 in setup.py? python-3.x python-3.x

Tests not being convered by 2to3 in setup.py?


In order for distribute to pick your module up and run in through 2to3, it must be listed in py_modules. So change that to:

py_modules=['mymodule', 'test_mymodule'],

Unfortunately this has a side-effect of installing test_mymodule when you install the project, which you probably did not want. For cases like this I will generally convert the project into a package with a mymodule.tests sub-package. This way the tests can be "installable" without adding additional clutter.