Re: Test suite failure
Guenter Milde <milde <at> users.berlios.de>
2009-11-16 20:23:03 GMT
On 2009-11-16, David Goodger wrote:
> 2009/11/16 Guenter Milde <milde <at> users.berlios.de>:
>> how should we procede with this false positive in the test suite?
> The problem is that the Docutils error reporting often depends on the
> text generated by Python exceptions. And that text changes between
> versions of Python.
In this case the text (and even the exception) varies between different
builds of the same version, but the problem (and cure) are similar.
> There is a mechanism for dealing with differences
> in exceptions between versions of Python: generate a similar
> exception, extract the text, and interpolate that text into the test.
> See the last test in
> test/test_parsers/test_rst/test_directives/test_unicode.py for an
> example. We simply do the same thing here.
Thanks for the pointer.
> It's a bit of a pain to handle these cases, but limited. We should
> handle such cases as required, in the same way they have been handled
> in the past.
However, the offending case in test_include.py tests not the unicode
directive, but error reporting for problems in included files.
* If we are going to replicate test cases for every possible reporter
call, this should be done re-using the original test cases. Otherwise a
lot of duplicate code needs to be maintained.
* If we agree to test a representative subset, we can concentrate on less
fragile test cases.
I'd prefer the second way. The attached patch does this.
Thanks,
Günter
Exec: svn 'diff' 2>&1
Dir: /home/milde/Code/Python/docutils-svn/docutils/test/test_parsers/test_rst/test_directives/
Index: include10.txt
===================================================================
--- include10.txt (Revision 6188)
+++ include10.txt (Arbeitskopie)
<at> <at> -1,4 +1,4 <at> <at>
-.. |bad| unicode:: 0xFFFFFFFFF
+.. include:: <nonexistent>
hi
-----
Index: test_include.py
===================================================================
--- test_include.py (Revision 6188)
+++ test_include.py (Arbeitskopie)
<at> <at> -325,25 +325,20 <at> <at>
""" % utf_16_file_rel],
# <at> <at> <at> BUG with errors reported with incorrect "source" & "line":
["""\
-Testing bad charent includes:
+Testing errors in included file:
.. include:: %s
""" % include10,
"""\
<document source="test data">
<paragraph>
- Testing bad charent includes:
- <system_message level="3" line="1" source="%s" type="ERROR">
+ Testing errors in included file:
+ <system_message level="4" line="1" source="%s" type="SEVERE">
<paragraph>
- Invalid character code: 0xFFFFFFFFF
- ValueError: unichr() arg not in range(0x110000) (wide Python build)
+ Problems with "include" directive path:
+ IOError: [Errno 2] No such file or directory: '%s'.
<literal_block xml:space="preserve">
- unicode:: 0xFFFFFFFFF
- <system_message level="2" line="1" source="%s" type="WARNING">
- <paragraph>
- Substitution definition "bad" empty or invalid.
- <literal_block xml:space="preserve">
- .. |bad| unicode:: 0xFFFFFFFFF
+ .. include:: <nonexistent>
<section dupnames="hi" ids="hi">
<title>
hi
<at> <at> -361,7 +356,7 <at> <at>
<system_message backrefs="id1" level="1" line="10" source="%s" type="INFO">
<paragraph>
Duplicate implicit target name: "hi".
-""" % (include10rel, include10rel, include10rel, include10rel)],
+""" % (include10rel, nonexistent_rel, include10rel, include10rel)],
["""\
Include file with whitespace in the path:
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.