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, 13 insertions, 1 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 d474419d5..d97516767 100755
--- a/test/test_parsers/test_rst/test_directives/test_tables.py
+++ b/test/test_parsers/test_rst/test_directives/test_tables.py
@@ -566,7 +566,7 @@ u"""\
<literal_block xml:space="preserve">
.. csv-table:: no such file
:file: bogus.csv
-"""],
+"""], # note that this output is rewritten below for certain python versions
["""\
.. csv-table:: bad URL
:url: bogus.csv
@@ -1074,6 +1074,18 @@ totest['list-table'] = [
]
+if csv:
+ # Rewrite csv tests that depend on the output of IOError as it is
+ # platform-dependent before python 2.4 for a unicode path.
+ # Here only needed for python 2.3 on non-windows
+ import sys
+ if sys.version_info < (2, 4) and not sys.platform.startswith('win'):
+ for i in range(len(totest['csv-table'])):
+ if totest['csv-table'][i][1].find("u'bogus.csv'") != -1:
+ totest['csv-table'][i][1] = totest['csv-table'][i][1].replace(
+ "u'bogus.csv'", "'bogus.csv'")
+
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')