Travis throws Python syntax error from a print statement in node-sass when using pytest
Question: I'm having a strange problem with Travis when testing a Django app with
[pytest-django](https://pypi.python.org/pypi/pytest-django). All my tests pass
locally and apparently on travis as well but no matter what I do, I get errors
from `node-sass` and `node-gyp` each time.

None of my test use any node modules (if that is even possible). I do use gulp
that has gulp-sass but that seems to work fine when it's ran before the tests
run.

Here is the error output:

    
    
    $ py.test --ds=<project>.settings.travis
    ============================= test session starts ==============================
    platform linux -- Python 3.4.2 -- py-1.4.26 -- pytest-2.6.4
    django settings: <project>.settings.travis (from command line option)
    plugins: django
    collected 13 items / 7 errors 
    <project>/tests/test_<suite_1>.py ..........
    <project>/tests/test_<suite_2>.py ...
    ==================================== ERRORS ====================================
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
     ERROR collecting node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py 
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/_pytest/python.py:463: in _importtestmodule
        mod = self.fspath.pyimport(ensuresyspath=True)
    ../../../virtualenv/python3.4.2/lib/python3.4/site-packages/py/_path/local.py:629: in pyimport
        __import__(pkgpath.basename)
    E     File "/home/travis/build/<user>/<project>/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 37
    E       print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
    E                            ^
    E   SyntaxError: invalid syntax
    ===================== 13 passed, 7 error in 20.94 seconds ======================
    


Answer: The problem turned out to be the (old) version of `pytest` already installed
in Travis satisfying the dependency in `pytest-django`. Adding the correct
version of `pytest` to `requirements.txt` fixed the issue.

