From: Guenter M. <mi...@us...> - 2016-11-17 22:11:24
|
On 2016-11-16, Yixuan Li wrote: Hello, > When I execute in shell: > cd <archive_directory_path>/test > ./alltests.py > It reports an syntax error: > bogon:docutils yixuanli$ cd test3 > bogon:test3 yixuanli$ ./alltests.py What Python version do you use? <archive_directory_path>/test is für Python 2 and <archive_directory_path>/test3 is for Python 3 > Traceback (most recent call last): > File "./alltests.py", line 22, in <module> > import DocutilsTestSupport # must be imported before docutils > File "/Users/yixuanli/Documents/MyDev/docutils/test3/DocutilsTestSupport.py", line 233 > print('\n%s\ninput:' % (self,), file=sys.stderr) > ^ > SyntaxError: invalid syntax This looks like trying the Python 3 tests with Python 2 Could you try again with the test directory matching the python version? The shellscript below tests with all supported Python versions. Günter #!/bin/bash # Run the docutils test suite cd ~/Code/Python/docutils-svn/docutils # run test suite with Python 2.x # ------------------------------ python2.7 test/alltests.py || exit $? python2.6 test/alltests.py || exit $? python2.5 test/alltests.py || exit $? python2.4 test/alltests.py || exit $? # tests with Python 3k # -------------------- # convert with 2to3: cd ~/Code/Python/docutils-svn/docutils python3 setup.py build || exit $? # and run the tests there:: python3.4 test3/alltests.py || exit $? python3.5 test3/alltests.py || exit $? python3.3 test3/alltests.py || exit $? python3.2 test3/alltests.py || exit $? python3.1 test3/alltests.py || exit $? |