I was trying to see how nose & unittesting were being used in a package I'm learning about. This package uses nosetester, which is provided with numpy (why this is done also confuses me). My nosetester.py is in /usr/local/lib/python2.7/dist-packages/numpy/testing/. I am running Python 2.7.6. However, when I add a tracing statement of the form:
print "Hi"
to the __init__ method of the NoseTester class, I get a syntax error:
File "/usr/local/lib/python2.7/dist-packages/numpy/testing/nosetester.py", line 182
print "Hi"
^
SyntaxError: invalid syntax
When I use
print ("Hi")
things work fine. I know my Python interpreter is using 2.7.6:
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
This leaves me wondering why the insistence on Python3 and is there anywhere else that I might run into this?
from __future__ import print_functionline in nosetester.py?