Python - Running talk + internet on Python 3.2 testenv

I am trying to implement a single-source testing system, which allows automatic testing in several versions of Python using current + networks.

The problem is that I cannot get it to work when I test Python 3.2. Everything works fine if I exclude Python 3.2.

Here is my tox.ini :

 [tox] envlist = py25,py26,py27,py32,pypy,jython [testenv] commands = nosetests [] deps = nose mock [testenv:py32] commands = nosetests [] 

and my ~/.noserc :

 [nosetests] verbosity=2 with-doctest=1 

I set the use_2to3 flag to True in my setup.py, but this error continues to be displayed: NameError: global name 'basestring' is not defined . It seems that I am missing some settings that should make 2to3 work, but I don't know what it is.

In addition, I tried replacing nosetests [] with python setup.py test in the testenv:py32 . Unfortunately, not only the same error continues to occur, but also introduces another error: Error in atexit._run_exitfuncs: TypeError: 'NoneType' object is not callable .

Any pointers?

EDIT: Added code to setup.py if useful:

 # handle python 3 if sys.version_info >= (3,): use_2to3 = True else: use_2to3 = False 

and somewhere in setup() : use_2to3 = use_2to3

+7
source share
1 answer

You can use something like this in the [testenv] section:

 changedir = {envtmpdir} commands = nosetests package # "package" is import name of the package under test 

or if you have tests in a separate directory than in the package:

 changedir = tests # directory where tests are living commands = nosetests [] 

This should prevent nose wrap due to an incorrect package version.

+1
source

All Articles