Discussion:
[Docutils-users] Test suite failure
Yixuan Li
2016-11-16 01:53:57 UTC
Permalink
Hello,

I'm writing to you to report a bug in "Running the Test Suite" http://docutils.sourceforge.net/README.html

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
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


Then I check the version by

cd ../tools
./quicktest.py --version

It says:
bogon:tools yixuanli$ ./quicktest.py --version
quicktest.py (Docutils 0.13 [repository])

Since there are a lot of interactions among your python files, I dare not to change only one code. Could you please kindly help me about that?

Btw, I appreciate deeply your docutils!

Cheers,
Yixuan
Guenter Milde
2016-11-17 22:11:06 UTC
Permalink
On 2016-11-16, Yixuan Li wrote:

Hello,
Post by Yixuan Li
cd <archive_directory_path>/test
./alltests.py
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
Post by Yixuan Li
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 $?

Loading...