summaryrefslogtreecommitdiff
path: root/test/test_parsers/test_rst/test_directives/test_tables.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_parsers/test_rst/test_directives/test_tables.py')
-rwxr-xr-xtest/test_parsers/test_rst/test_directives/test_tables.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/test_parsers/test_rst/test_directives/test_tables.py b/test/test_parsers/test_rst/test_directives/test_tables.py
index 924cf7793..e0b378554 100755
--- a/test/test_parsers/test_rst/test_directives/test_tables.py
+++ b/test/test_parsers/test_rst/test_directives/test_tables.py
@@ -10,7 +10,7 @@ Tests for tables.py directives.
from __init__ import DocutilsTestSupport
-import os
+import os, sys
import csv
from docutils.parsers.rst.directives import tables
@@ -32,6 +32,10 @@ if isinstance(unichr_exception, OverflowError):
else:
unichr_exception_string = str(unichr_exception)
+csv_eod_error_str = "unexpected end of data"
+if sys.version_info < (3,3):
+ csv_eod_error_str = "newline inside string"
+
def null_bytes():
import csv
csv_data = open(utf_16_csv, 'rb').read()
@@ -760,12 +764,12 @@ u"""\
<system_message level="3" line="1" source="test data" type="ERROR">
<paragraph>
Error with CSV data in "csv-table" directive:
- newline inside string
+ %s
<literal_block xml:space="preserve">
.. csv-table:: bad CSV data
\n\
"bad", \"csv, data
-"""],
+""" % csv_eod_error_str],
["""\
.. csv-table:: bad CSV header data
:header: "bad", \"csv, data
@@ -777,13 +781,13 @@ u"""\
<system_message level="3" line="1" source="test data" type="ERROR">
<paragraph>
Error with CSV data in "csv-table" directive:
- newline inside string
+ %s
<literal_block xml:space="preserve">
.. csv-table:: bad CSV header data
:header: "bad", \"csv, data
\n\
good, csv, data
-"""],
+""" % csv_eod_error_str],
["""\
.. csv-table:: bad encoding
:file: %s