diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-08-21 03:00:07 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-08-21 03:00:07 +0000 |
| commit | 0168bf250ce75e00e2d09f4ebb742fe562f6e426 (patch) | |
| tree | 4130cdb0bb4ceddac3825f1a7ef756fe60a0013b | |
| parent | ab473fe64d032214f73059758b2804f03fc01e42 (diff) | |
| download | docutils-0168bf250ce75e00e2d09f4ebb742fe562f6e426.tar.gz | |
updated
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@572 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
49 files changed, 778 insertions, 750 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index c5661415e..d101e201d 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -53,15 +53,24 @@ Changes Since 0.2 - Added automatic closing to ``FileInput`` and ``FileOutput``. - Delayed opening of ``FileOutput`` file until ``write()`` called. - ``FileOutput.write()`` now returns the encoded output string. + - Try to get path/stream name automatically in ``FileInput`` & + ``FileOutput``. * docutils/nodes.py: - Added "Invisible" element category class. - Changed ``Node.walk()`` & ``.walkabout()`` to permit more tree modification during a traversal. - - Added element classes: ``line_block``, ``generated``. + - Added element classes: ``line_block``, ``generated``, ``address``. - Added support for lists of nodes to ``Element.insert()``. - Fixed parent linking in ``Element.replace()``. + - Added new abstract superclass ``FixedTextElement``; adds + "xml:space" attribute. + +* docutils/utils.py: + + - Added a ``source`` attribute to Reporter instances and + ``system_message`` elements. * docutils/parsers/rst/states.py: @@ -84,6 +93,10 @@ Changes Since 0.2 - Added the ``peps.TargetNotes`` transform to the Reader. +* docutils/transforms/frontmatter.py: + + - Improved support for generic fields. + * docutils/transforms/parts.py: - Moved the "id" attribute from TOC list items to the references @@ -105,7 +118,7 @@ Changes Since 0.2 - "name" attributes only on these tags: a, applet, form, frame, iframe, img, map. - - Add "name" attribute to <a> in section titles for Netscape 4 + - Added "name" attribute to <a> in section titles for Netscape 4 support (bug report: Pearu Peterson). - Fixed targets (names) on footnote, citation, topic title, problematic, and system_message nodes (for Netscape 4). @@ -117,7 +130,9 @@ Changes Since 0.2 of text and `` `` for runs of spaces. - Improved modularity of output; added ``self.body_pre_docinfo`` and ``self.docinfo`` segments. - - Added support for "line_block" elements. + - Added support for "line_block", "address" elements. + - Improved backlinks (footnotes & system_messages). + - Improved system_message output. * docutils/writers/pep_html.py: @@ -161,6 +176,7 @@ Changes Since 0.2 - Added ``%number;`` attribute type parameter entity. - Changed ``%structural.elements;`` to ``%section.elements``. - Updated attribute types; made more specific. + - Added "address" bibliographic element. * spec/pep-0256.txt: Converted to reStructuredText & updated. diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt index 09441f077..bc367bc71 100644 --- a/docutils/docs/dev/todo.txt +++ b/docutils/docs/dev/todo.txt @@ -469,13 +469,14 @@ Directives .. include:: path/subdocument.txt :raw: - Implementation ideas: Model the directive parsing on the "images" + Implementation ideas: Model the directive parsing on the "images" directive. A separate, nested parse is probably needed, since it's not a good idea to alter the already-read data. Use ``state.nested_parse()`` (see directives/admonitions.py), and pass - in ``match_titles=1``. The reporting mechanism will have to be - revamped to include the file which is the source of system - messages. + in ``match_titles=1``. The reporting mechanism has been revamped + to include the file which is the source of system messages; a new + ``utils.Reporter`` object will need to be created for each input + source. YAGNI for now: Use C-preprocessor semantics for locating include files? E.g., ``.. include:: file.txt`` will read another file diff --git a/docutils/docs/ref/rst/restructuredtext.txt b/docutils/docs/ref/rst/restructuredtext.txt index 040393276..f96e86fe6 100644 --- a/docutils/docs/ref/rst/restructuredtext.txt +++ b/docutils/docs/ref/rst/restructuredtext.txt @@ -837,10 +837,10 @@ DTD elements: docinfo, author, authors, organization, contact, version, status, date, copyright, field, topic. When a field list is the first non-comment element in a document -(after the document title, if there is one), it may have certain -specific fields transformed to document bibliographic data. This -bibliographic data corresponds to the front matter of a book, such as -the title page and copyright page. +(after the document title, if there is one), it may have its fields +transformed to document bibliographic data. This bibliographic data +corresponds to the front matter of a book, such as the title page and +copyright page. Certain registered field names (listed below) are recognized and transformed to the corresponding DTD elements, most becoming child @@ -859,6 +859,7 @@ elements are as follows: - "Authors": authors. - "Organization": organization. - "Contact": contact. +- "Address": address. - "Version": version. - "Status": status. - "Date": date. @@ -876,6 +877,10 @@ single name is interpreted as an "Author". If a single name contains a comma, end it with a semicolon to disambiguate: ":Authors: Doe, Jane;". +The "Address" field is for a multi-line surface mailing address. A +specialized form of line block`_ (see `reStructuredText Directives`_), +newlines and whitespace will be preserved. + The "Dedication" and "Abstract" fields may contain arbitrary body elements. Only one of each is allowed. They become topic elements with "Dedication" or "Abstract" titles (or language equivalents) diff --git a/docutils/docutils/languages/en.py b/docutils/docutils/languages/en.py index 8488a902b..fb320511d 100644 --- a/docutils/docutils/languages/en.py +++ b/docutils/docutils/languages/en.py @@ -20,6 +20,7 @@ labels = { 'author': 'Author', 'authors': 'Authors', 'organization': 'Organization', + 'address': 'Address', 'contact': 'Contact', 'version': 'Version', 'revision': 'Revision', @@ -44,6 +45,7 @@ bibliographic_fields = { 'author': nodes.author, 'authors': nodes.authors, 'organization': nodes.organization, + 'address': nodes.address, 'contact': nodes.contact, 'version': nodes.version, 'revision': nodes.revision, diff --git a/docutils/docutils/parsers/rst/__init__.py b/docutils/docutils/parsers/rst/__init__.py index 66b594841..7894d8869 100644 --- a/docutils/docutils/parsers/rst/__init__.py +++ b/docutils/docutils/parsers/rst/__init__.py @@ -26,7 +26,7 @@ Usage 3. Create a new empty `docutils.nodes.document` tree:: - document = docutils.utils.new_document() + document = docutils.utils.new_document(source) See `docutils.utils.new_document()` for parameter details. diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py index fbd0ee8fc..95f03c461 100644 --- a/docutils/docutils/readers/__init__.py +++ b/docutils/docutils/readers/__init__.py @@ -30,8 +30,9 @@ class Reader(Component): """ transforms = () - """Ordered tuple of transform classes (each with a ``transform()`` method). - Populated by subclasses. `Reader.transform()` instantiates & runs them.""" + """Ordered tuple of transform classes (each with a ``transform()`` + method). Populated by subclasses. `Reader.transform()` + instantiates & runs them.""" def __init__(self, parser, parser_name): """ @@ -85,9 +86,7 @@ class Reader(Component): def new_document(self): """Create and return a new empty document tree (root node).""" - document = utils.new_document(self.options) - if self.source.source_path: - document['source'] = self.source.source_path + document = utils.new_document(self.source.source_path, self.options) return document diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index 923336edc..00ebefe61 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -268,7 +268,7 @@ class TransformTestCase(CustomTestCase): def test_transforms(self): if self.run_in_debugger: pdb.set_trace() - document = utils.new_document(self.options) + document = utils.new_document('test data', self.options) self.parser.parse(self.input, document) for transformClass in (self.transforms + universal.test_transforms): transformClass(document, self).transform() @@ -281,7 +281,7 @@ class TransformTestCase(CustomTestCase): print '\n', self.id print '-' * 70 print self.input - document = utils.new_document(self.options) + document = utils.new_document('test data', self.options) self.parser.parse(self.input, document) print '-' * 70 print document.pformat() @@ -314,7 +314,7 @@ class ParserTestCase(CustomTestCase): def test_parser(self): if self.run_in_debugger: pdb.set_trace() - document = utils.new_document(self.options) + document = utils.new_document('test data', self.options) self.parser.parse(self.input, document) output = document.pformat() self.compare_output(self.input, output, self.expected) diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index 0ac42e956..3766a695d 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -107,7 +107,7 @@ class MiscTests(unittest.TestCase): class TreeCopyVisitorTests(unittest.TestCase): def setUp(self): - document = utils.new_document() + document = utils.new_document('test data') document += nodes.paragraph('', 'Paragraph 1.') blist = nodes.bullet_list() for i in range(1, 6): diff --git a/docutils/test/test_parsers/test_rst/test_block_quotes.py b/docutils/test/test_parsers/test_rst/test_block_quotes.py index 9ef810972..f80761534 100755 --- a/docutils/test/test_parsers/test_rst/test_block_quotes.py +++ b/docutils/test/test_parsers/test_rst/test_block_quotes.py @@ -27,7 +27,7 @@ Line 2. Indented. """, """\ -<document> +<document source="test data"> <paragraph> Line 1. Line 2. @@ -44,7 +44,7 @@ Line 2. Indented 2. """, """\ -<document> +<document source="test data"> <paragraph> Line 1. Line 2. @@ -61,11 +61,11 @@ Line 2. Unexpectedly indented. """, """\ -<document> +<document source="test data"> <paragraph> Line 1. Line 2. - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unexpected indentation at line 3. <block_quote> @@ -80,14 +80,14 @@ Line 2. no blank line """, """\ -<document> +<document source="test data"> <paragraph> Line 1. Line 2. <block_quote> <paragraph> Indented. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Block quote ends without a blank line; unexpected unindent at line 5. <paragraph> @@ -104,7 +104,7 @@ Is this correct? Should it generate a warning? Yes, it is correct, no warning necessary. """, """\ -<document> +<document source="test data"> <paragraph> Here is a paragraph. <block_quote> diff --git a/docutils/test/test_parsers/test_rst/test_bullet_lists.py b/docutils/test/test_parsers/test_rst/test_bullet_lists.py index 61049ae8a..1cffde4c7 100755 --- a/docutils/test/test_parsers/test_rst/test_bullet_lists.py +++ b/docutils/test/test_parsers/test_rst/test_bullet_lists.py @@ -24,7 +24,7 @@ totest['bullet_lists'] = [ - item """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> <paragraph> @@ -36,7 +36,7 @@ totest['bullet_lists'] = [ * item 2 """, """\ -<document> +<document source="test data"> <bullet_list bullet="*"> <list_item> <paragraph> @@ -52,7 +52,7 @@ No blank line between: + item 2 """, """\ -<document> +<document source="test data"> <paragraph> No blank line between: <bullet_list bullet="+"> @@ -71,7 +71,7 @@ No blank line between: - item 2 """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> <paragraph> @@ -88,7 +88,7 @@ No blank line between: - item 2 """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> <paragraph> @@ -109,7 +109,7 @@ Different bullets: - item 4 """, """\ -<document> +<document source="test data"> <paragraph> Different bullets: <bullet_list bullet="-"> @@ -124,7 +124,7 @@ Different bullets: <list_item> <paragraph> item 3 - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bullet list ends without a blank line; unexpected unindent at line 8. <bullet_list bullet="-"> @@ -137,12 +137,12 @@ Different bullets: no blank line """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> <paragraph> item - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bullet list ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -154,7 +154,7 @@ no blank line empty item above """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> <paragraph> @@ -165,10 +165,10 @@ empty item above empty item above, no blank line """, """\ -<document> +<document source="test data"> <bullet_list bullet="-"> <list_item> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bullet list ends without a blank line; unexpected unindent at line 2. <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_citations.py b/docutils/test/test_parsers/test_rst/test_citations.py index 803b1f2c3..7421433db 100755 --- a/docutils/test/test_parsers/test_rst/test_citations.py +++ b/docutils/test/test_parsers/test_rst/test_citations.py @@ -24,7 +24,7 @@ totest['citations'] = [ .. [citation] This is a citation. """, """\ -<document> +<document source="test data"> <citation id="citation" name="citation"> <label> citation @@ -35,7 +35,7 @@ totest['citations'] = [ .. [citation1234] This is a citation with year. """, """\ -<document> +<document source="test data"> <citation id="citation1234" name="citation1234"> <label> citation1234 @@ -47,7 +47,7 @@ totest['citations'] = [ on multiple lines. """, """\ -<document> +<document source="test data"> <citation id="citation" name="citation"> <label> citation @@ -63,7 +63,7 @@ totest['citations'] = [ on multiple lines with less space. """, """\ -<document> +<document source="test data"> <citation id="citation1" name="citation1"> <label> citation1 @@ -83,7 +83,7 @@ totest['citations'] = [ whose block starts on line 2. """, """\ -<document> +<document source="test data"> <citation id="citation" name="citation"> <label> citation @@ -97,7 +97,7 @@ totest['citations'] = [ That was an empty citation. """, """\ -<document> +<document source="test data"> <citation id="citation" name="citation"> <label> citation @@ -109,11 +109,11 @@ That was an empty citation. No blank line. """, """\ -<document> +<document source="test data"> <citation id="citation" name="citation"> <label> citation - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -125,10 +125,10 @@ No blank line. .. [*citationlabelwithmarkup*] this isn't a citation """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> [citation label with spaces] this isn't a citation - <comment> + <comment xml:space="1"> [*citationlabelwithmarkup*] this isn't a citation """], ] diff --git a/docutils/test/test_parsers/test_rst/test_comments.py b/docutils/test/test_parsers/test_rst/test_comments.py index 1b5961c13..281982a8e 100755 --- a/docutils/test/test_parsers/test_rst/test_comments.py +++ b/docutils/test/test_parsers/test_rst/test_comments.py @@ -26,8 +26,8 @@ totest['comments'] = [ Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment <paragraph> Paragraph. @@ -39,8 +39,8 @@ Paragraph. Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment block. <paragraph> @@ -53,8 +53,8 @@ Paragraph. explicit markup start. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment consisting of multiple lines starting on the line after the explicit markup start. @@ -66,10 +66,10 @@ Paragraph. Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment. - <comment> + <comment xml:space="1"> Another. <paragraph> Paragraph. @@ -81,10 +81,10 @@ no blank line Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -100,12 +100,12 @@ no blank line Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment. - <comment> + <comment xml:space="1"> Another. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 3. <paragraph> @@ -119,8 +119,8 @@ Paragraph. Paragraph. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment:: <paragraph> Paragraph. @@ -133,8 +133,8 @@ The extra newline before the comment text prevents the parser from recognizing a directive. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> comment:: <paragraph> The extra newline before the comment text prevents @@ -148,8 +148,8 @@ The extra newline before the comment text prevents the parser from recognizing a hyperlink target. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> _comment: http://example.org <paragraph> The extra newline before the comment text prevents @@ -163,8 +163,8 @@ The extra newline before the comment text prevents the parser from recognizing a citation. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> [comment] Not a citation. <paragraph> The extra newline before the comment text prevents @@ -178,8 +178,8 @@ The extra newline before the comment text prevents the parser from recognizing a substitution definition. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> |comment| image:: bogus.png <paragraph> The extra newline before the comment text prevents @@ -194,11 +194,11 @@ the parser from recognizing a substitution definition. A block quote. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> Next is an empty comment, which serves to end this comment and prevents the following block quote being swallowed up. - <comment> + <comment xml:space="1"> <block_quote> <paragraph> A block quote. @@ -213,7 +213,7 @@ term 2 definition 2 """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -221,7 +221,7 @@ term 2 <definition> <paragraph> definition 1 - <comment> + <comment xml:space="1"> a comment <definition_list_item> <term> @@ -240,7 +240,7 @@ term 2 definition 2 """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -248,7 +248,7 @@ term 2 <definition> <paragraph> definition 1 - <comment> + <comment xml:space="1"> a comment <definition_list> <definition_list_item> @@ -268,14 +268,14 @@ term 2 bullet paragraph 3 """, """\ -<document> +<document source="test data"> <bullet_list bullet="+"> <list_item> <paragraph> bullet paragraph 1 <paragraph> bullet paragraph 2 - <comment> + <comment xml:space="1"> comment between bullet paragraphs 2 and 3 <paragraph> bullet paragraph 3 @@ -288,12 +288,12 @@ term 2 bullet paragraph 2 """, """\ -<document> +<document source="test data"> <bullet_list bullet="+"> <list_item> <paragraph> bullet paragraph 1 - <comment> + <comment xml:space="1"> comment between bullet paragraphs 1 (leader) and 2 <paragraph> bullet paragraph 2 @@ -304,12 +304,12 @@ term 2 .. trailing comment """, """\ -<document> +<document source="test data"> <bullet_list bullet="+"> <list_item> <paragraph> bullet - <comment> + <comment xml:space="1"> trailing comment """], ] diff --git a/docutils/test/test_parsers/test_rst/test_definition_lists.py b/docutils/test/test_parsers/test_rst/test_definition_lists.py index 0142420fe..f18b12fe0 100755 --- a/docutils/test/test_parsers/test_rst/test_definition_lists.py +++ b/docutils/test/test_parsers/test_rst/test_definition_lists.py @@ -25,7 +25,7 @@ term definition """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -41,7 +41,7 @@ term paragraph """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -58,7 +58,7 @@ term no blank line """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -66,7 +66,7 @@ no blank line <definition> <paragraph> definition - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Definition list ends without a blank line; unexpected unindent at line 3. <paragraph> @@ -77,13 +77,13 @@ A paragraph:: A literal block without a blank line first? """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> A paragraph:: <definition> - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Blank line missing before literal block? Interpreted as a definition list item. At line 2. <paragraph> @@ -95,11 +95,11 @@ a term may only be one line long this is not a definition """, """\ -<document> +<document source="test data"> <paragraph> this is not a term; a term may only be one line long - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unexpected indentation at line 3. <block_quote> @@ -114,7 +114,7 @@ term 2 definition 2 """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -136,7 +136,7 @@ term 2 definition 2 """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -159,7 +159,7 @@ term 2 No blank line after the definition list. """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -173,7 +173,7 @@ No blank line after the definition list. <definition> <paragraph> definition 2 - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Definition list ends without a blank line; unexpected unindent at line 5. <paragraph> @@ -195,7 +195,7 @@ term 2 paragraph """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -231,7 +231,7 @@ Term : classifier definition list item terms only. """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -252,7 +252,7 @@ Term \: not a classifier Because the colon is escaped. """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -278,7 +278,7 @@ Term `with *inline ``text **errors : classifier `with *errors ``too Definition `with *inline ``text **markup errors. """, """\ -<document> +<document source="test data"> <definition_list> <definition_list_item> <term> @@ -307,25 +307,25 @@ Term `with *inline ``text **errors : classifier `with *errors ``too `` too <definition> - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 1. - <system_message backrefs="id4" id="id3" level="2" type="WARNING"> + <system_message backrefs="id4" id="id3" level="2" source="test data" type="WARNING"> <paragraph> Inline emphasis start-string without end-string at line 1. - <system_message backrefs="id6" id="id5" level="2" type="WARNING"> + <system_message backrefs="id6" id="id5" level="2" source="test data" type="WARNING"> <paragraph> Inline literal start-string without end-string at line 1. - <system_message backrefs="id8" id="id7" level="2" type="WARNING"> + <system_message backrefs="id8" id="id7" level="2" source="test data" type="WARNING"> <paragraph> Inline strong start-string without end-string at line 1. - <system_message backrefs="id10" id="id9" level="2" type="WARNING"> + <system_message backrefs="id10" id="id9" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 1. - <system_message backrefs="id12" id="id11" level="2" type="WARNING"> + <system_message backrefs="id12" id="id11" level="2" source="test data" type="WARNING"> <paragraph> Inline emphasis start-string without end-string at line 1. - <system_message backrefs="id14" id="id13" level="2" type="WARNING"> + <system_message backrefs="id14" id="id13" level="2" source="test data" type="WARNING"> <paragraph> Inline literal start-string without end-string at line 1. <paragraph> @@ -342,16 +342,16 @@ Term `with *inline ``text **errors : classifier `with *errors ``too <problematic id="id22" refid="id21"> ** markup errors. - <system_message backrefs="id16" id="id15" level="2" type="WARNING"> + <system_message backrefs="id16" id="id15" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 2. - <system_message backrefs="id18" id="id17" level="2" type="WARNING"> + <system_message backrefs="id18" id="id17" level="2" source="test data" type="WARNING"> <paragraph> Inline emphasis start-string without end-string at line 2. - <system_message backrefs="id20" id="id19" level="2" type="WARNING"> + <system_message backrefs="id20" id="id19" level="2" source="test data" type="WARNING"> <paragraph> Inline literal start-string without end-string at line 2. - <system_message backrefs="id22" id="id21" level="2" type="WARNING"> + <system_message backrefs="id22" id="id21" level="2" source="test data" type="WARNING"> <paragraph> Inline strong start-string without end-string at line 2. """], diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py b/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py index 87f82d527..7e319d5dd 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py @@ -47,7 +47,7 @@ totest['admonitions'] = [ - Back up your data. """, """\ -<document> +<document source="test data"> <attention> <paragraph> Directives at large. @@ -98,7 +98,7 @@ totest['admonitions'] = [ .. note:: No blank lines in-between. """, """\ -<document> +<document source="test data"> <note> <paragraph> One-line notes. diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_contents.py b/docutils/test/test_parsers/test_rst/test_directives/test_contents.py index 8fcdd3be7..f4a1f0b1a 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_contents.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_contents.py @@ -24,7 +24,7 @@ totest['contents'] = [ .. contents:: """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -36,7 +36,7 @@ totest['contents'] = [ .. contents:: Table of Contents """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -51,7 +51,7 @@ totest['contents'] = [ Table of Contents """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -67,7 +67,7 @@ totest['contents'] = [ Contents """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -81,7 +81,7 @@ totest['contents'] = [ .. contents:: *Table* of ``Contents`` """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -101,7 +101,7 @@ totest['contents'] = [ :local: """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -118,7 +118,7 @@ totest['contents'] = [ :backlinks: none """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.parts.Contents @@ -136,13 +136,13 @@ totest['contents'] = [ :depth: two """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "contents" directive attributes at line 1: invalid attribute value: (attribute: "depth"; value: 'two') invalid literal for int(): two. - <literal_block> + <literal_block xml:space="1"> .. contents:: :depth: two """], @@ -151,12 +151,12 @@ totest['contents'] = [ :width: 2 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "contents" directive attributes at line 1: unknown attribute: "width". - <literal_block> + <literal_block xml:space="1"> .. contents:: :width: 2 """], @@ -165,13 +165,13 @@ totest['contents'] = [ :backlinks: no way! """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "contents" directive attributes at line 1: invalid attribute value: (attribute: "backlinks"; value: 'no way!') "no way!" unknown; choose from "top", "entry", or "none". - <literal_block> + <literal_block xml:space="1"> .. contents:: :backlinks: no way! """], @@ -180,13 +180,13 @@ totest['contents'] = [ :backlinks: """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "contents" directive attributes at line 1: invalid attribute value: (attribute: "backlinks"; value: None) must supply an argument; choose from "top", "entry", or "none". - <literal_block> + <literal_block xml:space="1"> .. contents:: :backlinks: """], diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py b/docutils/test/test_parsers/test_rst/test_directives/test_figures.py index 32e884932..02a5a94ed 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_figures.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_figures.py @@ -24,7 +24,7 @@ totest['figures'] = [ .. figure:: picture.png """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> """], @@ -32,11 +32,11 @@ totest['figures'] = [ .. figure:: not an image URI """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Image URI at line 1 contains whitespace. - <literal_block> + <literal_block xml:space="1"> .. figure:: not an image URI """], ["""\ @@ -45,7 +45,7 @@ totest['figures'] = [ A picture with a caption. """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> <caption> @@ -57,13 +57,13 @@ totest['figures'] = [ - A picture with an invalid caption. """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Figure caption must be a paragraph or empty comment. - <literal_block> + <literal_block xml:space="1"> .. figure:: picture.png \n\ - A picture with an invalid caption. @@ -74,11 +74,11 @@ totest['figures'] = [ And a caption. """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Image URI at line 1 contains whitespace. - <literal_block> + <literal_block xml:space="1"> .. figure:: not an image URI \n\ And a caption. @@ -91,7 +91,7 @@ totest['figures'] = [ A picture with a legend but no caption. """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> <legend> @@ -107,7 +107,7 @@ totest['figures'] = [ A picture with image attributes and a caption. """, """\ -<document> +<document source="test data"> <figure> <image height="100" scale="50" uri="picture.png" width="200"> <caption> @@ -123,7 +123,7 @@ totest['figures'] = [ A picture with image attributes on individual lines, and this caption. """, """\ -<document> +<document source="test data"> <figure> <image alt="alternate text" height="100" scale="50" uri="picture.png" width="200"> <caption> @@ -136,7 +136,7 @@ This figure lacks a caption. It may still have a .. figure:: picture.png """, """\ -<document> +<document source="test data"> <paragraph> This figure lacks a caption. It may still have a "Figure 1."-style caption appended in the output. @@ -159,7 +159,7 @@ This figure lacks a caption. It may still have a +-----------------------+-----------------------+ """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> <caption> @@ -207,7 +207,7 @@ This figure lacks a caption. It may still have a be a single paragraph.) """, """\ -<document> +<document source="test data"> <figure> <image uri="picture.png"> <legend> @@ -244,7 +244,7 @@ Testing for line-leaks: .. figure:: picture.png """, """\ -<document> +<document source="test data"> <paragraph> Testing for line-leaks: <figure> diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_images.py b/docutils/test/test_parsers/test_rst/test_directives/test_images.py index 66047591d..0068f2bbf 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_images.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_images.py @@ -24,29 +24,29 @@ totest['images'] = [ .. image:: picture.png """, """\ -<document> +<document source="test data"> <image uri="picture.png"> """], ["""\ .. image:: """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Missing image URI argument at line 1. - <literal_block> + <literal_block xml:space="1"> .. image:: """], ["""\ .. image:: one two three """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Image URI at line 1 contains whitespace. - <literal_block> + <literal_block xml:space="1"> .. image:: one two three """], ["""\ @@ -56,7 +56,7 @@ totest['images'] = [ :scale: 50 """, """\ -<document> +<document source="test data"> <image height="100" scale="50" uri="picture.png" width="200"> """], ["""\ @@ -67,7 +67,7 @@ totest['images'] = [ :scale: 50 """, """\ -<document> +<document source="test data"> <image height="100" scale="50" uri="picture.png" width="200"> """], ["""\ @@ -77,11 +77,11 @@ totest['images'] = [ :scale: 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Missing image URI argument at line 1. - <literal_block> + <literal_block xml:space="1"> .. image:: :height: 100 :width: 200 @@ -95,7 +95,7 @@ totest['images'] = [ :scale: 50 """, """\ -<document> +<document source="test data"> <image height="100" scale="50" uri="a/very/long/path/to/picture.png" width="200"> """], ["""\ @@ -106,7 +106,7 @@ totest['images'] = [ :alt: Alternate text for the picture """, """\ -<document> +<document source="test data"> <image alt="Alternate text for the picture" height="100" scale="50" uri="picture.png" width="200"> """], ["""\ @@ -114,13 +114,13 @@ totest['images'] = [ :scale: - 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute data: extension attribute field body may contain a single paragraph only (attribute "scale"). - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :scale: - 50 """], @@ -129,13 +129,13 @@ totest['images'] = [ :scale: """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute value: (attribute: "scale"; value: None) object can't be converted to int. - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :scale: """], @@ -144,12 +144,12 @@ totest['images'] = [ :scale 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute block. - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :scale 50 """], @@ -158,11 +158,11 @@ totest['images'] = [ scale: 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Image URI at line 1 contains whitespace. - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png scale: 50 """], @@ -171,12 +171,12 @@ totest['images'] = [ :: 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute block. - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :: 50 """], @@ -185,12 +185,12 @@ totest['images'] = [ :sale: 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: unknown attribute: "sale". - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :sale: 50 """], @@ -199,13 +199,13 @@ totest['images'] = [ :scale: fifty """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute value: (attribute: "scale"; value: 'fifty') invalid literal for int(): fifty. - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :scale: fifty """], @@ -215,12 +215,12 @@ totest['images'] = [ :scale: 50 """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error in "image" directive attributes at line 1: invalid attribute data: duplicate attribute "scale". - <literal_block> + <literal_block xml:space="1"> .. image:: picture.png :scale: 50 :scale: 50 diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_meta.py b/docutils/test/test_parsers/test_rst/test_directives/test_meta.py index 55c7328a2..9d00ece67 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_meta.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_meta.py @@ -26,7 +26,7 @@ totest['meta'] = [ :keywords: plaintext,markup language """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.components.Filter @@ -50,7 +50,7 @@ totest['meta'] = [ :description lang=fr: Un histoire amusant """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.components.Filter @@ -73,7 +73,7 @@ totest['meta'] = [ :http-equiv=Content-Type: text/html; charset=ISO-8859-1 """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.components.Filter @@ -89,7 +89,7 @@ totest['meta'] = [ over multiple lines """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.components.Filter @@ -106,7 +106,7 @@ Paragraph :name: content """, """\ -<document> +<document source="test data"> <paragraph> Paragraph <pending> @@ -122,8 +122,8 @@ Paragraph .. meta:: """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Empty meta directive at line 1. """], @@ -132,11 +132,11 @@ Paragraph :empty: """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> No content for meta tag "empty" at line 2. - <literal_block> + <literal_block xml:space="1"> :empty: """], ["""\ @@ -144,11 +144,11 @@ Paragraph not a field list """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Invalid meta directive at line 2. - <literal_block> + <literal_block xml:space="1"> .. meta:: not a field list """], @@ -158,7 +158,7 @@ Paragraph not a field """, """\ -<document> +<document source="test data"> <pending> .. internal attributes: .transform: docutils.transforms.components.Filter @@ -167,10 +167,10 @@ Paragraph nodes: <meta content="content" name="name"> writer: 'html' - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Invalid meta directive at line 3. - <literal_block> + <literal_block xml:space="1"> .. meta:: :name: content not a field @@ -180,11 +180,11 @@ Paragraph :name notattval: content """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Error parsing meta tag attribute "notattval" at line 2: missing "=". - <literal_block> + <literal_block xml:space="1"> :name notattval: content """], ] diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py b/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py index 4c7feb970..4b783c17d 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py @@ -26,8 +26,8 @@ totest['test_directives'] = [ Paragraph. """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Directive processed. Type="reStructuredText-test-directive", data="", directive block: None <paragraph> @@ -39,8 +39,8 @@ Paragraph. Paragraph. """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Directive processed. Type="reStructuredText-test-directive", data="argument", directive block: None <paragraph> @@ -54,11 +54,11 @@ Paragraph. Paragraph. """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Directive processed. Type="reStructuredText-test-directive", data="", directive block: - <literal_block> + <literal_block xml:space="1"> Directive block contains one paragraph, with a blank line before. <paragraph> Paragraph. @@ -70,11 +70,11 @@ Paragraph. Paragraph. """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Directive processed. Type="reStructuredText-test-directive", data="", directive block: - <literal_block> + <literal_block xml:space="1"> Directive block contains one paragraph, no blank line before. <paragraph> Paragraph. @@ -87,13 +87,13 @@ no blank line. Paragraph. """, """\ -<document> - <system_message level="1" type="INFO"> +<document source="test data"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Directive processed. Type="reStructuredText-test-directive", data="", directive block: - <literal_block> + <literal_block xml:space="1"> block - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 3. <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_topics.py b/docutils/test/test_parsers/test_rst/test_directives/test_topics.py index 000f98799..cbad1f6b0 100644 --- a/docutils/test/test_parsers/test_rst/test_directives/test_topics.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_topics.py @@ -24,13 +24,13 @@ totest['topics'] = [ .. topic:: """, """\ -<document> +<document source="test data"> """], ["""\ .. topic:: Title """, """\ -<document> +<document source="test data"> <topic> <title> Title @@ -41,7 +41,7 @@ totest['topics'] = [ Body. """, """\ -<document> +<document source="test data"> <topic> <title> Title @@ -56,7 +56,7 @@ totest['topics'] = [ Body. """, """\ -<document> +<document source="test data"> <topic> <title> Title @@ -68,11 +68,11 @@ totest['topics'] = [ Body. """, """\ -<document> +<document source="test data"> <topic> <title> Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> The second line of a topic block must be blank (line 2). <paragraph> @@ -85,11 +85,11 @@ totest['topics'] = [ Body. """, """\ -<document> +<document source="test data"> <topic> <title> Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> The second line of a topic block must be blank (line 4). <paragraph> @@ -103,14 +103,14 @@ totest['topics'] = [ Body. """, """\ -<document> +<document source="test data"> <topic> <title> Title - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Topics may not be nested within body elements (line 2). - <literal_block> + <literal_block xml:space="1"> .. topic:: Nested \n\ Body. @@ -124,18 +124,18 @@ totest['topics'] = [ More. """, """\ -<document> +<document source="test data"> <topic> <title> Title - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Topics may not be nested within body elements (line 2). - <literal_block> + <literal_block xml:space="1"> .. topic:: Nested \n\ Body. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 5. <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py b/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py index 46af7dcfd..f29a6cc98 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py @@ -29,21 +29,21 @@ totest['unknown'] = [ block """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unknown directive type "reStructuredText-unknown-directive" at line 1. - <literal_block> + <literal_block xml:space="1"> .. reStructuredText-unknown-directive:: - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unknown directive type "reStructuredText-unknown-directive" at line 3. - <literal_block> + <literal_block xml:space="1"> .. reStructuredText-unknown-directive:: argument - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unknown directive type "reStructuredText-unknown-directive" at line 5. - <literal_block> + <literal_block xml:space="1"> .. reStructuredText-unknown-directive:: block """], diff --git a/docutils/test/test_parsers/test_rst/test_doctest_blocks.py b/docutils/test/test_parsers/test_rst/test_doctest_blocks.py index 70f182fd0..7f5caefae 100755 --- a/docutils/test/test_parsers/test_rst/test_doctest_blocks.py +++ b/docutils/test/test_parsers/test_rst/test_doctest_blocks.py @@ -29,10 +29,10 @@ Doctest block. Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph. - <doctest_block> + <doctest_block xml:space="1"> >>> print "Doctest block." Doctest block. <paragraph> @@ -45,10 +45,10 @@ Paragraph. Indented output. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph. - <doctest_block> + <doctest_block xml:space="1"> >>> print " Indented output." Indented output. """], @@ -59,11 +59,11 @@ Paragraph. Indented block & output. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph. <block_quote> - <doctest_block> + <doctest_block xml:space="1"> >>> print " Indented block & output." Indented block & output. """], diff --git a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py b/docutils/test/test_parsers/test_rst/test_enumerated_lists.py index 8a5b03485..aca5fc35f 100755 --- a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py +++ b/docutils/test/test_parsers/test_rst/test_enumerated_lists.py @@ -28,7 +28,7 @@ totest['enumerated_lists'] = [ 3. Item three. """, """\ -<document> +<document source="test data"> <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> @@ -48,7 +48,7 @@ No blank lines betwen items: 3. Item three. """, """\ -<document> +<document source="test data"> <paragraph> No blank lines betwen items: <enumerated_list enumtype="arabic" prefix="" suffix="."> @@ -67,7 +67,7 @@ No blank lines betwen items: empty item above, no blank line """, """\ -<document> +<document source="test data"> <paragraph> 1. empty item above, no blank line @@ -86,17 +86,17 @@ Scrambled: 1. Item one. """, """\ -<document> +<document source="test data"> <paragraph> Scrambled: - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Enumerated list start value not ordinal-1 at line 3: "3" (ordinal 3) <enumerated_list enumtype="arabic" prefix="" start="3" suffix="."> <list_item> <paragraph> Item three. - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Enumerated list start value not ordinal-1 at line 5: "2" (ordinal 2) <enumerated_list enumtype="arabic" prefix="" start="2" suffix="."> @@ -120,14 +120,14 @@ Skipping item 3: 4. Item 4. """, """\ -<document> +<document source="test data"> <paragraph> Skipping item 3: <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> Item 1. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 4. <paragraph> @@ -148,10 +148,10 @@ And again: 3. Item three. """, """\ -<document> +<document source="test data"> <paragraph> Start with non-ordinal-1: - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Enumerated list start value not ordinal-1 at line 3: "0" (ordinal 0) <enumerated_list enumtype="arabic" prefix="" start="0" suffix="."> @@ -169,7 +169,7 @@ And again: Item three. <paragraph> And again: - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Enumerated list start value not ordinal-1 at line 10: "2" (ordinal 2) <enumerated_list enumtype="arabic" prefix="" start="2" suffix="."> @@ -191,7 +191,7 @@ And again: Paragraph 2. """, """\ -<document> +<document source="test data"> <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> @@ -232,7 +232,7 @@ ii. Item ii. iii. Item iii. """, """\ -<document> +<document source="test data"> <paragraph> Different enumeration sequences: <enumerated_list enumtype="arabic" prefix="" suffix="."> @@ -309,7 +309,7 @@ iiii. iiii (IVXLCDM) IVXLCDM """, """\ -<document> +<document source="test data"> <paragraph> Bad Roman numerals: <enumerated_list enumtype="lowerroman" prefix="" suffix="."> @@ -364,7 +364,7 @@ iii. Item iii. Phew! Safe! """, """\ -<document> +<document source="test data"> <paragraph> Potentially ambiguous cases: <enumerated_list enumtype="upperalpha" prefix="" suffix="."> @@ -438,7 +438,7 @@ ii. Item ii. iii. Item iii. """, """\ -<document> +<document source="test data"> <paragraph> Definitely ambiguous: <enumerated_list enumtype="upperalpha" prefix="" suffix="."> @@ -466,7 +466,7 @@ iii. Item iii. <list_item> <paragraph> Item H. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 11. <enumerated_list enumtype="upperroman" prefix="" suffix="."> @@ -504,7 +504,7 @@ iii. Item iii. <list_item> <paragraph> Item h. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 23. <enumerated_list enumtype="lowerroman" prefix="" suffix="."> @@ -534,7 +534,7 @@ Different enumeration formats: (3) Item (3). """, """\ -<document> +<document source="test data"> <paragraph> Different enumeration formats: <enumerated_list enumtype="arabic" prefix="" suffix="."> @@ -596,7 +596,7 @@ Nested enumerated lists: 3. Item 3. """, """\ -<document> +<document source="test data"> <paragraph> Nested enumerated lists: <enumerated_list enumtype="arabic" prefix="" suffix="."> @@ -658,7 +658,7 @@ Princeton, NJ. """, # @@@ I think this is the correct result, but I'm not certain: """\ -<document> +<document source="test data"> <enumerated_list enumtype="upperalpha" prefix="" suffix="."> <list_item> <paragraph> @@ -666,7 +666,7 @@ Princeton, NJ. <list_item> <paragraph> Physicist, who was a colleague of - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 3. <paragraph> @@ -684,7 +684,7 @@ Princeton, NJ. Paragraph 2. """, """\ -<document> +<document source="test data"> <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> @@ -693,23 +693,23 @@ Princeton, NJ. <list_item> <paragraph> Item two: line 1, - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 4. <block_quote> <paragraph> line 2. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Block quote ends without a blank line; unexpected unindent at line 5. - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Enumerated list start value not ordinal-1 at line 5: "3" (ordinal 3) <enumerated_list enumtype="arabic" prefix="" start="3" suffix="."> <list_item> <paragraph> Item three: paragraph 1, line 1, - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 6. <block_quote> diff --git a/docutils/test/test_parsers/test_rst/test_field_lists.py b/docutils/test/test_parsers/test_rst/test_field_lists.py index 082b252d1..6105c8651 100755 --- a/docutils/test/test_parsers/test_rst/test_field_lists.py +++ b/docutils/test/test_parsers/test_rst/test_field_lists.py @@ -32,7 +32,7 @@ One-liners: :Parameter i: integer """, """\ -<document> +<document source="test data"> <paragraph> One-liners: <field_list> @@ -72,7 +72,7 @@ One-liners, no blank lines: :Parameter i: integer """, """\ -<document> +<document source="test data"> <paragraph> One-liners, no blank lines: <field_list> @@ -108,13 +108,13 @@ One-liners, no blank lines: empty item above, no blank line """, """\ -<document> +<document source="test data"> <field_list> <field> <field_name> field <field_body> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Field list ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -133,7 +133,7 @@ Field bodies starting on the next line: integer """, """\ -<document> +<document source="test data"> <paragraph> Field bodies starting on the next line: <field_list> @@ -178,7 +178,7 @@ One-paragraph, multi-liners: (integer) """, """\ -<document> +<document source="test data"> <paragraph> One-paragraph, multi-liners: <field_list> @@ -228,7 +228,7 @@ One-paragraph, multi-liners, not lined up: (integer) """, """\ -<document> +<document source="test data"> <paragraph> One-paragraph, multi-liners, not lined up: <field_list> @@ -287,7 +287,7 @@ Multiple body elements: :Time: 15:07 """, """\ -<document> +<document source="test data"> <paragraph> Multiple body elements: <field_list> @@ -314,7 +314,7 @@ Multiple body elements: containing multiple elements. <paragraph> Here's a literal block: - <literal_block> + <literal_block xml:space="1"> def f(x): return x**2 + x <paragraph> @@ -350,7 +350,7 @@ Nested field lists on one line: body line 2 """, """\ -<document> +<document source="test data"> <paragraph> Nested field lists on one line: <field_list> @@ -410,7 +410,7 @@ Nested field lists on one line: :Parameter i j k: multiple arguments """, """\ -<document> +<document source="test data"> <field_list> <field> <field_name> @@ -443,7 +443,7 @@ Field: marker is missing its open-colon. :Field marker is missing its close-colon. """, """\ -<document> +<document source="test data"> <paragraph> Some edge cases: <field_list> @@ -457,7 +457,7 @@ Field: marker is missing its open-colon. <field_body> <paragraph> Me - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Field list ends without a blank line; unexpected unindent at line 5. <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_footnotes.py b/docutils/test/test_parsers/test_rst/test_footnotes.py index 60511b1a6..00fbca31d 100755 --- a/docutils/test/test_parsers/test_rst/test_footnotes.py +++ b/docutils/test/test_parsers/test_rst/test_footnotes.py @@ -24,7 +24,7 @@ totest['footnotes'] = [ .. [1] This is a footnote. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 @@ -36,7 +36,7 @@ totest['footnotes'] = [ on multiple lines. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 @@ -52,7 +52,7 @@ totest['footnotes'] = [ on multiple lines with less space. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 @@ -72,7 +72,7 @@ totest['footnotes'] = [ whose block starts on line 2. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 @@ -86,7 +86,7 @@ totest['footnotes'] = [ That was an empty footnote. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 @@ -98,11 +98,11 @@ That was an empty footnote. No blank line. """, """\ -<document> +<document source="test data"> <footnote id="id1" name="1"> <label> 1 - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -122,7 +122,7 @@ totest['auto_numbered_footnotes'] = [ [#]_ is the third auto-numbered footnote reference. """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1"> is the first auto-numbered footnote reference. @@ -156,7 +156,7 @@ Here are some internal cross-references to the targets generated by the footnotes: first_, second_, third_. """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1" refname="third"> is a reference to the third auto-numbered footnote. @@ -204,7 +204,7 @@ Mixed anonymous and labelled auto-numbered footnotes: .. [#five] Auto-numbered footnote 5 again (duplicate). """, """\ -<document> +<document source="test data"> <paragraph> Mixed anonymous and labelled auto-numbered footnotes: <paragraph> @@ -236,7 +236,7 @@ Mixed anonymous and labelled auto-numbered footnotes: <paragraph> Auto-numbered footnote 5. <footnote auto="1" dupname="five" id="id9"> - <system_message backrefs="id9" level="2" type="WARNING"> + <system_message backrefs="id9" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "five". <paragraph> @@ -260,7 +260,7 @@ and labelled auto-numbered footnotes: .. [#] Auto-numbered footnote 6. """, """\ -<document> +<document source="test data"> <paragraph> Mixed manually-numbered, anonymous auto-numbered, and labelled auto-numbered footnotes: @@ -303,7 +303,7 @@ and labelled auto-numbered footnotes: <paragraph> Auto-numbered footnote 5. <footnote auto="1" dupname="five" id="id12"> - <system_message backrefs="id12" level="2" type="WARNING"> + <system_message backrefs="id12" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "five". <paragraph> @@ -319,7 +319,7 @@ totest['auto_symbol_footnotes'] = [ .. [*] This is an auto-symbol footnote. """, """\ -<document> +<document source="test data"> <footnote auto="*" id="id1"> <paragraph> This is an auto-symbol footnote. diff --git a/docutils/test/test_parsers/test_rst/test_inline_markup.py b/docutils/test/test_parsers/test_rst/test_inline_markup.py index 12e0638eb..373841c69 100755 --- a/docutils/test/test_parsers/test_rst/test_inline_markup.py +++ b/docutils/test/test_parsers/test_rst/test_inline_markup.py @@ -24,7 +24,7 @@ totest['emphasis'] = [ *emphasis* """, """\ -<document> +<document source="test data"> <paragraph> <emphasis> emphasis @@ -34,7 +34,7 @@ totest['emphasis'] = [ across lines* """, """\ -<document> +<document source="test data"> <paragraph> <emphasis> emphasized sentence @@ -44,12 +44,12 @@ across lines* *emphasis without closing asterisk """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> * emphasis without closing asterisk - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline emphasis start-string without end-string at line 1. """], @@ -63,7 +63,7 @@ or *the\\* *stars\\\\\\* *inside* what about *this**? """, """\ -<document> +<document source="test data"> <paragraph> ' <emphasis> @@ -87,7 +87,7 @@ what about *this**? <problematic id="id2" refid="id1"> * args' will trigger a warning and may be problematic) - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline emphasis start-string without end-string at line 5. <paragraph> @@ -102,7 +102,7 @@ Emphasized asterisk: *\\** Emphasized double asterisk: *\\*** """, """\ -<document> +<document source="test data"> <paragraph> Emphasized asterisk: \n\ <emphasis> @@ -119,7 +119,7 @@ totest['strong'] = [ **strong** """, """\ -<document> +<document source="test data"> <paragraph> <strong> strong @@ -130,7 +130,7 @@ totest['strong'] = [ (however, '**kwargs' will trigger a warning and may be problematic) """, """\ -<document> +<document source="test data"> <paragraph> ( <strong> @@ -141,7 +141,7 @@ totest['strong'] = [ <problematic id="id2" refid="id1"> ** kwargs' will trigger a warning and may be problematic) - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline strong start-string without end-string at line 3. """], @@ -151,7 +151,7 @@ Strong asterisk: ***** Strong double asterisk: ****** """, """\ -<document> +<document source="test data"> <paragraph> Strong asterisk: \n\ <strong> @@ -165,12 +165,12 @@ Strong double asterisk: ****** **strong without closing asterisks """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> ** strong without closing asterisks - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline strong start-string without end-string at line 1. """], @@ -181,7 +181,7 @@ totest['literal'] = [ ``literal`` """, """\ -<document> +<document source="test data"> <paragraph> <literal> literal @@ -190,7 +190,7 @@ totest['literal'] = [ ``\\literal`` """, """\ -<document> +<document source="test data"> <paragraph> <literal> \\literal @@ -199,7 +199,7 @@ totest['literal'] = [ ``lite\\ral`` """, """\ -<document> +<document source="test data"> <paragraph> <literal> lite\\ral @@ -208,7 +208,7 @@ totest['literal'] = [ ``literal\\`` """, """\ -<document> +<document source="test data"> <paragraph> <literal> literal\\ @@ -220,7 +220,7 @@ totest['literal'] = [ and may be problematic) """, """\ -<document> +<document source="test data"> <paragraph> <literal> literal ``TeX quotes'' & \\backslash @@ -231,7 +231,7 @@ and may be problematic) `` standalone TeX quotes'' will trigger a warning and may be problematic) - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline literal start-string without end-string at line 3. """], @@ -239,7 +239,7 @@ and may be problematic) Find the ```interpreted text``` in this paragraph! """, """\ -<document> +<document source="test data"> <paragraph> Find the \n\ <literal> @@ -250,12 +250,12 @@ Find the ```interpreted text``` in this paragraph! ``literal without closing backquotes """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> `` literal without closing backquotes - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline literal start-string without end-string at line 1. """], @@ -266,7 +266,7 @@ totest['interpreted'] = [ `interpreted` """, """\ -<document> +<document source="test data"> <paragraph> <interpreted> interpreted @@ -275,7 +275,7 @@ totest['interpreted'] = [ :role:`interpreted` """, """\ -<document> +<document source="test data"> <paragraph> <interpreted position="prefix" role="role"> interpreted @@ -284,7 +284,7 @@ totest['interpreted'] = [ `interpreted`:role: """, """\ -<document> +<document source="test data"> <paragraph> <interpreted position="suffix" role="role"> interpreted @@ -293,11 +293,11 @@ totest['interpreted'] = [ :role:`interpreted`:role: """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> :role:`interpreted`:role: - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Multiple roles in interpreted text at line 1 (both prefix and suffix present; only one allowed). """], @@ -305,7 +305,7 @@ totest['interpreted'] = [ :role:`:not-role: interpreted` """, """\ -<document> +<document source="test data"> <paragraph> <interpreted position="prefix" role="role"> :not-role: interpreted @@ -314,7 +314,7 @@ totest['interpreted'] = [ :very.long-role_name:`interpreted` """, """\ -<document> +<document source="test data"> <paragraph> <interpreted position="prefix" role="very.long-role_name"> interpreted @@ -323,7 +323,7 @@ totest['interpreted'] = [ `interpreted` but not \\`interpreted` [`] or ({[`] or [`]}) or ` """, """\ -<document> +<document source="test data"> <paragraph> <interpreted> interpreted @@ -333,7 +333,7 @@ totest['interpreted'] = [ `interpreted`-text `interpreted`: text `interpreted`:text `text`'s interpreted """, """\ -<document> +<document source="test data"> <paragraph> <interpreted> interpreted @@ -352,12 +352,12 @@ totest['interpreted'] = [ `interpreted without closing backquote """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> ` interpreted without closing backquote - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 1. """], @@ -368,7 +368,7 @@ totest['references'] = [ ref_ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="ref"> ref @@ -377,7 +377,7 @@ ref_ ref__ """, """\ -<document> +<document source="test data"> <paragraph> <reference anonymous="1"> ref @@ -386,7 +386,7 @@ ref__ ref_, r_, r_e-f_, -ref_, and anonymousref__, but not _ref_ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="ref"> ref @@ -411,7 +411,7 @@ totest['phrase_references'] = [ `phrase reference`_ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="phrase reference"> phrase reference @@ -420,7 +420,7 @@ totest['phrase_references'] = [ `anonymous reference`__ """, """\ -<document> +<document source="test data"> <paragraph> <reference anonymous="1"> anonymous reference @@ -430,7 +430,7 @@ totest['phrase_references'] = [ across lines`_ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="phrase reference across lines"> phrase reference @@ -440,7 +440,7 @@ across lines`_ `phrase\`_ reference`_ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="phrase`_ reference"> phrase`_ reference @@ -451,13 +451,13 @@ Invalid phrase reference: :role:`phrase reference`_ """, """\ -<document> +<document source="test data"> <paragraph> Invalid phrase reference: <paragraph> <problematic id="id2" refid="id1"> :role:`phrase reference`_ - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Mismatch: both interpreted text role prefix and reference suffix at line 3. """], @@ -467,13 +467,13 @@ Invalid phrase reference: `phrase reference`:role:_ """, """\ -<document> +<document source="test data"> <paragraph> Invalid phrase reference: <paragraph> <problematic id="id2" refid="id1"> `phrase reference`:role:_ - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Mismatch: both interpreted text role suffix and reference suffix at line 3. """], @@ -481,7 +481,7 @@ Invalid phrase reference: `phrase reference_ without closing backquote """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> ` @@ -489,7 +489,7 @@ Invalid phrase reference: <reference refname="reference"> reference without closing backquote - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 1. """], @@ -497,7 +497,7 @@ Invalid phrase reference: `anonymous phrase reference__ without closing backquote """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> ` @@ -505,7 +505,7 @@ Invalid phrase reference: <reference anonymous="1"> reference without closing backquote - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline interpreted text or phrase reference start-string without end-string at line 1. """], @@ -521,7 +521,7 @@ another target`, spanning lines. _`Here is a TaRgeT` with case and spacial difficulties. """, """\ -<document> +<document source="test data"> <paragraph> <target id="target" name="target"> target @@ -545,7 +545,7 @@ But this isn't a _target; targets require backquotes. And _`this`_ is just plain confusing. """, """\ -<document> +<document source="test data"> <paragraph> But this isn't a _target; targets require backquotes. <paragraph> @@ -553,7 +553,7 @@ And _`this`_ is just plain confusing. <problematic id="id2" refid="id1"> _` this`_ is just plain confusing. - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline target start-string without end-string at line 3. """], @@ -561,12 +561,12 @@ And _`this`_ is just plain confusing. _`inline target without closing backquote """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> _` inline target without closing backquote - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline target start-string without end-string at line 1. """], @@ -577,7 +577,7 @@ totest['footnote_reference'] = [ [1]_ """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference id="id1" refname="1"> 1 @@ -586,7 +586,7 @@ totest['footnote_reference'] = [ [#]_ """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1"> """], @@ -594,7 +594,7 @@ totest['footnote_reference'] = [ [#label]_ """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1" refname="label"> """], @@ -602,7 +602,7 @@ totest['footnote_reference'] = [ [*]_ """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="*" id="id1"> """], @@ -613,7 +613,7 @@ totest['citation_reference'] = [ [citation]_ """, """\ -<document> +<document source="test data"> <paragraph> <citation_reference id="id1" refname="citation"> citation @@ -622,7 +622,7 @@ totest['citation_reference'] = [ [citation]_ and [cit-ation]_ and [cit.ation]_ and [CIT1]_ but not [CIT 1]_ """, """\ -<document> +<document source="test data"> <paragraph> <citation_reference id="id1" refname="citation"> citation @@ -644,7 +644,7 @@ totest['substitution_references'] = [ |subref| """, """\ -<document> +<document source="test data"> <paragraph> <substitution_reference refname="subref"> subref @@ -653,7 +653,7 @@ totest['substitution_references'] = [ |subref|_ and |subref|__ """, """\ -<document> +<document source="test data"> <paragraph> <reference refname="subref"> <substitution_reference refname="subref"> @@ -667,7 +667,7 @@ totest['substitution_references'] = [ |substitution reference| """, """\ -<document> +<document source="test data"> <paragraph> <substitution_reference refname="substitution reference"> substitution reference @@ -677,7 +677,7 @@ totest['substitution_references'] = [ reference| """, """\ -<document> +<document source="test data"> <paragraph> <substitution_reference refname="substitution reference"> substitution @@ -687,12 +687,12 @@ reference| |substitution reference without closing verbar """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id2" refid="id1"> | substitution reference without closing verbar - <system_message backrefs="id2" id="id1" level="2" type="WARNING"> + <system_message backrefs="id2" id="id1" level="2" source="test data" type="WARNING"> <paragraph> Inline substitution_reference start-string without end-string at line 1. """], @@ -719,7 +719,7 @@ ftp://ends.with.a.period. (a.question.mark@end?) """, """\ -<document> +<document source="test data"> <paragraph> <reference refuri="http://www.standalone.hyperlink.com"> http://www.standalone.hyperlink.com @@ -758,7 +758,7 @@ None of these are standalone hyperlinks (their "schemes" are not recognized): signal:noise, a:b. """, """\ -<document> +<document source="test data"> <paragraph> None of these are standalone hyperlinks (their "schemes" are not recognized): signal:noise, a:b. @@ -770,7 +770,7 @@ totest['miscellaneous'] = [ __This__ should be left alone. """, """\ -<document> +<document source="test data"> <paragraph> __This__ should be left alone. """], diff --git a/docutils/test/test_parsers/test_rst/test_literal_blocks.py b/docutils/test/test_parsers/test_rst/test_literal_blocks.py index 9e0c21ce5..93353b8dc 100755 --- a/docutils/test/test_parsers/test_rst/test_literal_blocks.py +++ b/docutils/test/test_parsers/test_rst/test_literal_blocks.py @@ -26,10 +26,10 @@ A paragraph:: A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -38,10 +38,10 @@ A paragraph with a space after the colons:: \n\ A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph with a space after the colons: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -58,14 +58,14 @@ Another paragraph:: A final paragraph. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. <paragraph> Another paragraph: - <literal_block> + <literal_block xml:space="1"> Another literal block. With two blank lines following. <paragraph> @@ -79,12 +79,12 @@ one line:: A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph on more than one line: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -95,15 +95,15 @@ one line:: with no blank line above. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph on more than one line: - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unexpected indentation at line 4. - <literal_block> + <literal_block xml:space="1"> A literal block with no blank line above. """], @@ -114,12 +114,12 @@ A paragraph:: no blank line """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Literal block ends without a blank line; unexpected unindent at line 4. <paragraph> @@ -131,10 +131,10 @@ A paragraph: :: A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -145,10 +145,10 @@ A paragraph: A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -158,10 +158,10 @@ A paragraph: A literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A literal block. """], ["""\ @@ -170,10 +170,10 @@ A paragraph:: Not a literal block. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Literal block expected at line 2; none found. <paragraph> @@ -188,10 +188,10 @@ A paragraph:: Literal line 3. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph: - <literal_block> + <literal_block xml:space="1"> A wonky literal block. Literal line 2. \n\ @@ -201,10 +201,10 @@ A paragraph:: EOF, even though a literal block is indicated:: """, """\ -<document> +<document source="test data"> <paragraph> EOF, even though a literal block is indicated: - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Literal block expected at line 2; none found. """], diff --git a/docutils/test/test_parsers/test_rst/test_option_lists.py b/docutils/test/test_parsers/test_rst/test_option_lists.py index bbabe51a6..ba5e3ad12 100755 --- a/docutils/test/test_parsers/test_rst/test_option_lists.py +++ b/docutils/test/test_parsers/test_rst/test_option_lists.py @@ -30,7 +30,7 @@ Short options: -c name option -c """, """\ -<document> +<document source="test data"> <paragraph> Short options: <option_list> @@ -73,7 +73,7 @@ Long options: --h_i_j_k option --h_i_j_k """, """\ -<document> +<document source="test data"> <paragraph> Long options: <option_list> @@ -132,7 +132,7 @@ Old GNU-style options: +c name option +c """, """\ -<document> +<document source="test data"> <paragraph> Old GNU-style options: <option_list> @@ -175,7 +175,7 @@ VMS/DOS-style options: /EEE=int option /EEE """, """\ -<document> +<document source="test data"> <paragraph> VMS/DOS-style options: <option_list> @@ -237,7 +237,7 @@ Mixed short, long, and VMS/DOS options: /F file option /F """, """\ -<document> +<document source="test data"> <paragraph> Mixed short, long, and VMS/DOS options: <option_list> @@ -305,7 +305,7 @@ Aliased options: -b file, --bbbb=file, /B file option -b, --bbbb, /B """, """\ -<document> +<document source="test data"> <paragraph> Aliased options: <option_list> @@ -353,7 +353,7 @@ Multiple lines in descriptions, aligned: line 2 """, """\ -<document> +<document source="test data"> <paragraph> Multiple lines in descriptions, aligned: <option_list> @@ -387,7 +387,7 @@ Multiple lines in descriptions, not aligned: line 2 """, """\ -<document> +<document source="test data"> <paragraph> Multiple lines in descriptions, not aligned: <option_list> @@ -423,7 +423,7 @@ Descriptions begin on next line: line 2 """, """\ -<document> +<document source="test data"> <paragraph> Descriptions begin on next line: <option_list> @@ -460,7 +460,7 @@ Multiple body elements in descriptions: para 2 """, """\ -<document> +<document source="test data"> <paragraph> Multiple body elements in descriptions: <option_list> @@ -492,7 +492,7 @@ Multiple body elements in descriptions: empty item above, no blank line """, """\ -<document> +<document source="test data"> <paragraph> --option empty item above, no blank line @@ -518,7 +518,7 @@ An option list using mixed delimiters in one line: --long1=arg1, --long2 arg2 Description """, """\ -<document> +<document source="test data"> <paragraph> An option list using equals: <option_list> @@ -641,7 +641,7 @@ These next ones should be simple paragraphs: -1 and this one too. """, """\ -<document> +<document source="test data"> <paragraph> Some edge cases: <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_outdenting.py b/docutils/test/test_parsers/test_rst/test_outdenting.py index 314c50837..d4daf3b49 100755 --- a/docutils/test/test_parsers/test_rst/test_outdenting.py +++ b/docutils/test/test_parsers/test_rst/test_outdenting.py @@ -31,7 +31,7 @@ This paragraph ends the bullet list item before a block quote. Block quote. """, """\ -<document> +<document source="test data"> <paragraph> Anywhere a paragraph would have an effect on the current indentation level, a comment or list item should also. @@ -62,12 +62,12 @@ This paragraph ends the bullet list item before a block quote. Block quote. """, """\ -<document> +<document source="test data"> <bullet_list bullet="+"> <list_item> <paragraph> bullet - <comment> + <comment xml:space="1"> Comments swallow up all indented text following. \n\ (Therefore this is not a) block quote. @@ -78,7 +78,7 @@ This paragraph ends the bullet list item before a block quote. <paragraph> If we want a block quote after this bullet list item, we need to use an empty comment: - <comment> + <comment xml:space="1"> <block_quote> <paragraph> Block quote. diff --git a/docutils/test/test_parsers/test_rst/test_paragraphs.py b/docutils/test/test_parsers/test_rst/test_paragraphs.py index 296562cab..150387f75 100755 --- a/docutils/test/test_parsers/test_rst/test_paragraphs.py +++ b/docutils/test/test_parsers/test_rst/test_paragraphs.py @@ -24,7 +24,7 @@ totest['paragraphs'] = [ A paragraph. """, """\ -<document> +<document source="test data"> <paragraph> A paragraph. """], @@ -34,7 +34,7 @@ Paragraph 1. Paragraph 2. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph 1. <paragraph> @@ -46,7 +46,7 @@ Line 2. Line 3. """, """\ -<document> +<document source="test data"> <paragraph> Line 1. Line 2. @@ -62,7 +62,7 @@ Line 2. Line 3. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph 1, Line 1. Line 2. @@ -77,7 +77,7 @@ A. Einstein was a really smart dude. """, """\ -<document> +<document source="test data"> <paragraph> A. Einstein was a really smart dude. diff --git a/docutils/test/test_parsers/test_rst/test_section_headers.py b/docutils/test/test_parsers/test_rst/test_section_headers.py index 1f614cacd..0ecc9b571 100755 --- a/docutils/test/test_parsers/test_rst/test_section_headers.py +++ b/docutils/test/test_parsers/test_rst/test_section_headers.py @@ -27,7 +27,7 @@ Title Paragraph. """, """\ -<document> +<document source="test data"> <section id="title" name="title"> <title> Title @@ -40,7 +40,7 @@ Title Paragraph (no blank line). """, """\ -<document> +<document source="test data"> <section id="title" name="title"> <title> Title @@ -56,7 +56,7 @@ Title Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph. <section id="title" name="title"> @@ -78,27 +78,27 @@ Test unexpected section titles. Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Test unexpected section titles. <block_quote> - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Unexpected section title at line 4. - <literal_block> + <literal_block xml:space="1"> Title ===== <paragraph> Paragraph. - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Unexpected section title or transition at line 7. - <literal_block> + <literal_block xml:space="1"> ----- - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Unexpected section title at line 9. - <literal_block> + <literal_block xml:space="1"> Title ----- <paragraph> @@ -111,14 +111,14 @@ Title Test short underline. """, """\ -<document> +<document source="test data"> <section id="title" name="title"> <title> Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Title underline too short at line 2. - <literal_block> + <literal_block xml:space="1"> Title ==== <paragraph> @@ -132,7 +132,7 @@ Title Test overline title. """, """\ -<document> +<document source="test data"> <section id="title" name="title"> <title> Title @@ -147,7 +147,7 @@ Test overline title. Test overline title with inset. """, """\ -<document> +<document source="test data"> <section id="title" name="title"> <title> Title @@ -159,11 +159,11 @@ Test overline title with inset. Test Missing Underline """, """\ -<document> - <system_message level="4" type="SEVERE"> +<document source="test data"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Incomplete section title at line 1. - <literal_block> + <literal_block xml:space="1"> ======================== Test Missing Underline """], @@ -173,11 +173,11 @@ Test overline title with inset. """, """\ -<document> - <system_message level="4" type="SEVERE"> +<document source="test data"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Missing underline for overline at line 1. - <literal_block> + <literal_block xml:space="1"> ======================== Test Missing Underline """], @@ -188,11 +188,11 @@ Test overline title with inset. Test missing underline, with paragraph. """, """\ -<document> - <system_message level="4" type="SEVERE"> +<document source="test data"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Missing underline for overline at line 1. - <literal_block> + <literal_block xml:space="1"> ======= Title <paragraph> @@ -206,14 +206,14 @@ Test missing underline, with paragraph. Test long title and space normalization. """, """\ -<document> +<document source="test data"> <section id="long-title" name="long title"> <title> Long Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Title overline too short at line 1. - <literal_block> + <literal_block xml:space="1"> ======= Long Title ======= @@ -228,11 +228,11 @@ Test long title and space normalization. Paragraph. """, """\ -<document> - <system_message level="4" type="SEVERE"> +<document source="test data"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Title overline & underline mismatch at line 1. - <literal_block> + <literal_block xml:space="1"> ======= Title ------- @@ -251,12 +251,12 @@ Test missing titles; blank line in-between. ======================== """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Document or section may not begin with a transition (line 1). <transition> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> At least one body element must separate transitions; adjacent transitions at line 3. <transition> @@ -264,7 +264,7 @@ Test missing titles; blank line in-between. Test missing titles; blank line in-between. <transition> <transition> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Document or section may not end with a transition (line 9). """], @@ -278,19 +278,19 @@ Test missing titles; nothing in-between. ======================== """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Invalid section title or transition marker at line 1. - <literal_block> + <literal_block xml:space="1"> ======================== ======================== <paragraph> Test missing titles; nothing in-between. - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Invalid section title or transition marker at line 6. - <literal_block> + <literal_block xml:space="1"> ======================== ======================== """], @@ -314,8 +314,8 @@ Title 4 Paragraph 4. """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> Test return to existing, highest-level section (Title 3). <section id="title-1" name="title 1"> <title> @@ -362,7 +362,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <paragraph> Test return to existing, highest-level section (Title 3, with overlines). <section id="title-1" name="title 1"> @@ -406,7 +406,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <paragraph> Test return to existing, higher-level section (Title 4). <section id="title-1" name="title 1"> @@ -450,7 +450,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <paragraph> Test bad subsection order (Title 4). <section id="title-1" name="title 1"> @@ -468,10 +468,10 @@ Paragraph 4. Title 3 <paragraph> Paragraph 3. - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Title level inconsistent at line 15: - <literal_block> + <literal_block xml:space="1"> Title 4 ``````` <paragraph> @@ -501,7 +501,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <paragraph> Test bad subsection order (Title 4, with overlines). <section id="title-1" name="title 1"> @@ -519,10 +519,10 @@ Paragraph 4. Title 3 <paragraph> Paragraph 3. - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Title level inconsistent at line 19: - <literal_block> + <literal_block xml:space="1"> ``````` Title 4 ``````` @@ -536,7 +536,7 @@ Title containing *inline* ``markup`` Paragraph. """, """\ -<document> +<document source="test data"> <section id="title-containing-inline-markup" name="title containing inline markup"> <title> Title containing \n\ @@ -555,7 +555,7 @@ Paragraph. Paragraph. """, """\ -<document> +<document source="test data"> <section id="numbered-title" name="1. numbered title"> <title> 1. Numbered Title @@ -571,7 +571,7 @@ Paragraph. Paragraph. """, """\ -<document> +<document source="test data"> <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> @@ -579,7 +579,7 @@ Paragraph. <list_item> <paragraph> Item 2. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Enumerated list ends without a blank line; unexpected unindent at line 3. <section id="numbered-title" name="3. numbered title"> diff --git a/docutils/test/test_parsers/test_rst/test_substitutions.py b/docutils/test/test_parsers/test_rst/test_substitutions.py index 3f1c34c68..f504b9f80 100755 --- a/docutils/test/test_parsers/test_rst/test_substitutions.py +++ b/docutils/test/test_parsers/test_rst/test_substitutions.py @@ -26,7 +26,7 @@ Here's an image substitution definition: .. |symbol| image:: symbol.png """, """\ -<document> +<document source="test data"> <paragraph> Here's an image substitution definition: <substitution_definition name="symbol"> @@ -39,7 +39,7 @@ Embedded directive starts on the next line: image:: symbol.png """, """\ -<document> +<document source="test data"> <paragraph> Embedded directive starts on the next line: <substitution_definition name="symbol"> @@ -55,7 +55,7 @@ Here's a series of substitution definitions: .. |symbol 3| image:: symbol3.png """, """\ -<document> +<document source="test data"> <paragraph> Here's a series of substitution definitions: <substitution_definition name="symbol 1"> @@ -70,7 +70,7 @@ Here's a series of substitution definitions: split across lines| image:: symbol.png """, """\ -<document> +<document source="test data"> <substitution_definition name="very long substitution text, split across lines"> <image alt="very long substitution text, split across lines" uri="symbol.png"> """], @@ -84,7 +84,7 @@ Followed by a paragraph. Followed by a block quote. """, """\ -<document> +<document source="test data"> <substitution_definition name="symbol 1"> <image alt="symbol 1" uri="symbol.png"> <paragraph> @@ -102,12 +102,12 @@ Here are some duplicate substitution definitions: .. |symbol| image:: symbol.png """, """\ -<document> +<document source="test data"> <paragraph> Here are some duplicate substitution definitions: <substitution_definition dupname="symbol"> <image alt="symbol" uri="symbol.png"> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Duplicate substitution definition name: "symbol". <substitution_definition name="symbol"> @@ -133,56 +133,56 @@ No blank line after. .. | bad name | bad data """, """\ -<document> +<document source="test data"> <paragraph> Here are some bad cases: <substitution_definition name="symbol"> <image alt="symbol" uri="symbol.png"> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 4. <paragraph> No blank line after. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Substitution definition "empty" missing contents at line 6. - <literal_block> + <literal_block xml:space="1"> .. |empty| - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unknown directive type "directive" at line 8. - <literal_block> + <literal_block xml:space="1"> directive:: symbol.png - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Substitution definition "unknown" empty or invalid at line 8. - <literal_block> + <literal_block xml:space="1"> .. |unknown| directive:: symbol.png - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Substitution definition "invalid 1" empty or invalid at line 10. - <literal_block> + <literal_block xml:space="1"> .. |invalid 1| there's no directive here - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Substitution definition "invalid 2" empty or invalid at line 11. - <literal_block> + <literal_block xml:space="1"> .. |invalid 2| there's no directive here With some block quote text, line 1. And some more, line 2. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 12. <block_quote> <paragraph> With some block quote text, line 1. And some more, line 2. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Substitution definition "invalid 3" empty or invalid at line 15. - <literal_block> + <literal_block xml:space="1"> .. |invalid 3| there's no directive here - <comment> + <comment xml:space="1"> | bad name | bad data """], ] diff --git a/docutils/test/test_parsers/test_rst/test_tables.py b/docutils/test/test_parsers/test_rst/test_tables.py index 2b45cd527..1c2b6afff 100755 --- a/docutils/test/test_parsers/test_rst/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_tables.py @@ -26,7 +26,7 @@ totest['full_tables'] = [ +-------------------------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="1"> <colspec colwidth="37"> @@ -43,7 +43,7 @@ totest['full_tables'] = [ +-----------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="1"> <colspec colwidth="23"> @@ -60,11 +60,11 @@ totest['full_tables'] = [ +-----------------------+ """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. - <literal_block> + <literal_block xml:space="1"> +-----------------------+ | A malformed table. | +-----------------------+ @@ -79,7 +79,7 @@ totest['full_tables'] = [ +------------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="1"> <colspec colwidth="24"> @@ -103,7 +103,7 @@ totest['full_tables'] = [ +--------------+--------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -125,7 +125,7 @@ totest['full_tables'] = [ +--------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="1"> <colspec colwidth="14"> @@ -147,7 +147,7 @@ totest['full_tables'] = [ +--------------+-------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -176,7 +176,7 @@ totest['full_tables'] = [ +------------------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -205,7 +205,7 @@ totest['full_tables'] = [ +--------------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="12"> @@ -236,7 +236,7 @@ totest['full_tables'] = [ +--------------+--------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -264,7 +264,7 @@ totest['full_tables'] = [ +------------+-------------+---------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="3"> <colspec colwidth="12"> @@ -302,7 +302,7 @@ Complex spanning pattern (no edge knows all rows/cols): +-------------------------+-----------+ """, """\ -<document> +<document source="test data"> <paragraph> Complex spanning pattern (no edge knows all rows/cols): <table> @@ -344,7 +344,7 @@ Complex spanning pattern (no edge knows all rows/cols): +------------------------+------------+---------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="4"> <colspec colwidth="24"> @@ -419,7 +419,7 @@ Complex spanning pattern (no edge knows all rows/cols): No blank line after table. """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="17"> @@ -439,7 +439,7 @@ No blank line after table. <entry> <paragraph> cell 4 - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Blank line required after table at line 6. <paragraph> @@ -454,7 +454,7 @@ No blank line after table. Unexpected indent and no blank line after table. """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="17"> @@ -474,10 +474,10 @@ No blank line after table. <entry> <paragraph> cell 4 - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Unexpected indentation at line 6. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Blank line required after table at line 6. <block_quote> @@ -492,12 +492,12 @@ No blank line after table. +----------------------------+ """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. Malformed table; parse incomplete. - <literal_block> + <literal_block xml:space="1"> +--------------+-------------+ | A bad table. | | +--------------+ | @@ -514,7 +514,7 @@ No blank line after table. +------------------------------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="1"> <colspec colwidth="30"> @@ -540,7 +540,7 @@ No blank line after table. +------------------+--------+ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="18"> @@ -568,7 +568,7 @@ A table with two columns. Paragraph. """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="12"> @@ -591,7 +591,7 @@ and two rows. ============ ============ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="12"> @@ -619,7 +619,7 @@ two rows, and a column span. ============================ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="12"> @@ -651,7 +651,7 @@ two rows, and a column span. == =========== =========== """, """\ -<document> +<document source="test data"> <table> <tgroup cols="3"> <colspec colwidth="2"> @@ -702,7 +702,7 @@ A table with three columns. ================== ======== """, """\ -<document> +<document source="test data"> <table> <tgroup cols="3"> <colspec colwidth="7"> @@ -723,12 +723,12 @@ A simple table with no bottom border """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. No bottom table border found. - <literal_block> + <literal_block xml:space="1"> ============== ====== A simple table with no bottom border @@ -741,17 +741,17 @@ cell 3 cell 4 No blank line after table. """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. No bottom table border found or no blank line after table bottom. - <literal_block> + <literal_block xml:space="1"> ============== ====== A simple table cell 2 cell 3 cell 4 ============== ====== - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Blank line required after table at line 5. <paragraph> @@ -766,7 +766,7 @@ cell 3 cell 4 No blank line after table. """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -787,7 +787,7 @@ No blank line after table. <entry> <paragraph> cell 4 - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Blank line required after table at line 6. <paragraph> @@ -801,17 +801,17 @@ cell 3 cell 4 Unexpected indent and no blank line after table. """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. No bottom table border found or no blank line after table bottom. - <literal_block> + <literal_block xml:space="1"> ============== ====== A simple table cell 2 cell 3 cell 4 ============== ====== - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Blank line required after table at line 5. <block_quote> @@ -825,12 +825,12 @@ cell 3 cell 4 ============ ======== """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. Column span alignment problem at line offset 2. - <literal_block> + <literal_block xml:space="1"> ============== ====== A bad table cell 2 cell 3 cell 4 @@ -843,12 +843,12 @@ cell 3 cell 4 ======== ========= """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. Text in column margin at line offset 1. - <literal_block> + <literal_block xml:space="1"> ======== ========= A bad table cell 2 cell 3 cell 4 @@ -867,7 +867,7 @@ cell 3 cell 4 == ============================ """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="2"> @@ -913,7 +913,7 @@ with empty cells ================ ====== """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="16"> @@ -939,7 +939,7 @@ with empty cells ============== ======== """, """\ -<document> +<document source="test data"> <table> <tgroup cols="2"> <colspec colwidth="14"> @@ -968,12 +968,12 @@ cell 3 the bottom border below is too long ============== ======== """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Malformed table at line 1; formatting as a literal block. Bottom/header table border does not match top border. - <literal_block> + <literal_block xml:space="1"> ============== ====== A simple table this text extends to the right cell 3 the bottom border below is too long diff --git a/docutils/test/test_parsers/test_rst/test_targets.py b/docutils/test/test_parsers/test_rst/test_targets.py index 172a0ecd6..e290d48ed 100755 --- a/docutils/test/test_parsers/test_rst/test_targets.py +++ b/docutils/test/test_parsers/test_rst/test_targets.py @@ -26,7 +26,7 @@ totest['targets'] = [ (Internal hyperlink target.) """, """\ -<document> +<document source="test data"> <target id="target" name="target"> <paragraph> (Internal hyperlink target.) @@ -47,7 +47,7 @@ External hyperlink targets: .. _not-indirect: uri\_ """, """\ -<document> +<document source="test data"> <paragraph> External hyperlink targets: <target id="one-liner" name="one-liner" refuri="http://structuredtext.sourceforge.net"> @@ -63,7 +63,7 @@ Indirect hyperlink targets: .. _target2: `phrase-link reference`_ """, """\ -<document> +<document source="test data"> <paragraph> Indirect hyperlink targets: <target id="target1" name="target1" refname="reference"> @@ -78,21 +78,21 @@ Indirect hyperlink targets: ending with an underscore, but not a phrase-link_ """, """\ -<document> - <system_message level="2" type="WARNING"> +<document source="test data"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Hyperlink target at line 1 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> .. _target1: Not a proper hyperlink target - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Hyperlink target at line 3 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> .. _target2: Although it ends with an underscore, this is not a phrase-link_ - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Hyperlink target at line 5 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> .. _target3: A multi-line verson of something ending with an underscore, but not a phrase-link_ """], @@ -105,21 +105,21 @@ __ A multi-line verson of something ending with an underscore, but not a phrase-link_ """, """\ -<document> - <system_message level="2" type="WARNING"> +<document source="test data"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Hyperlink target at line 1 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> .. __: Not a proper hyperlink target - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Anonymous hyperlink target at line 3 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> __ Although it ends with an underscore, this is not a phrase-link_ - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Anonymous hyperlink target at line 5 contains whitespace. Perhaps a footnote was intended? - <literal_block> + <literal_block xml:space="1"> __ A multi-line verson of something ending with an underscore, but not a phrase-link_ """], @@ -131,7 +131,7 @@ __ A multi-line verson of something .. _a target name\: including a colon (escaped): """, """\ -<document> +<document source="test data"> <target id="a-long-target-name" name="a long target name"> <target id="a-target-name-including-a-colon-quoted" name="a target name: including a colon (quoted)"> <target id="a-target-name-including-a-colon-escaped" name="a target name: including a colon (escaped)"> @@ -143,7 +143,7 @@ __ A multi-line verson of something with backquotes`: """, """\ -<document> +<document source="test data"> <target id="a-very-long-target-name-split-across-lines" name="a very long target name, split across lines"> <target id="and-another-with-backquotes" name="and another, with backquotes"> """], @@ -153,7 +153,7 @@ External hyperlink: .. _target: http://www.python.org/ """, """\ -<document> +<document source="test data"> <paragraph> External hyperlink: <target id="target" name="target" refuri="http://www.python.org/"> @@ -166,11 +166,11 @@ Duplicate external targets (different URIs): .. _target: second """, """\ -<document> +<document source="test data"> <paragraph> Duplicate external targets (different URIs): <target dupname="target" id="target" refuri="first"> - <system_message backrefs="id1" level="2" type="WARNING"> + <system_message backrefs="id1" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "target". <target dupname="target" id="id1" refuri="second"> @@ -183,11 +183,11 @@ Duplicate external targets (same URIs): .. _target: first """, """\ -<document> +<document source="test data"> <paragraph> Duplicate external targets (same URIs): <target id="target" name="target" refuri="first"> - <system_message backrefs="id1" level="1" type="INFO"> + <system_message backrefs="id1" level="1" source="test data" type="INFO"> <paragraph> Duplicate explicit target name: "target". <target dupname="target" id="id1" refuri="first"> @@ -206,7 +206,7 @@ Title Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Duplicate implicit targets. <section dupname="title" id="title"> @@ -217,7 +217,7 @@ Paragraph. <section dupname="title" id="id1"> <title> Title - <system_message backrefs="id1" level="1" type="INFO"> + <system_message backrefs="id1" level="1" source="test data" type="INFO"> <paragraph> Duplicate implicit target name: "title". <paragraph> @@ -234,13 +234,13 @@ Title Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Duplicate implicit/explicit targets. <section dupname="title" id="title"> <title> Title - <system_message backrefs="id1" level="1" type="INFO"> + <system_message backrefs="id1" level="1" source="test data" type="INFO"> <paragraph> Duplicate implicit target name: "title". <target id="id1" name="title"> @@ -263,19 +263,19 @@ Second. Third. """, """\ -<document> +<document source="test data"> <paragraph> Duplicate explicit targets. <target dupname="title" id="title"> <paragraph> First. - <system_message backrefs="id1" level="2" type="WARNING"> + <system_message backrefs="id1" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "title". <target dupname="title" id="id1"> <paragraph> Second. - <system_message backrefs="id2" level="2" type="WARNING"> + <system_message backrefs="id2" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "title". <target dupname="title" id="id2"> @@ -301,7 +301,7 @@ Explicit internal target. .. _target: Explicit_external_target """, """\ -<document> +<document source="test data"> <paragraph> Duplicate targets: <section dupname="target" id="target"> @@ -312,24 +312,24 @@ Explicit internal target. <citation dupname="target" id="id1"> <label> target - <system_message backrefs="id1" level="1" type="INFO"> + <system_message backrefs="id1" level="1" source="test data" type="INFO"> <paragraph> Duplicate implicit target name: "target". <paragraph> Citation target. <footnote auto="1" dupname="target" id="id2"> - <system_message backrefs="id2" level="2" type="WARNING"> + <system_message backrefs="id2" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "target". <paragraph> Autonumber-labeled footnote target. - <system_message backrefs="id3" level="2" type="WARNING"> + <system_message backrefs="id3" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "target". <target dupname="target" id="id3"> <paragraph> Explicit internal target. - <system_message backrefs="id4" level="2" type="WARNING"> + <system_message backrefs="id4" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "target". <target dupname="target" id="id4" refuri="Explicit_external_target"> @@ -343,7 +343,7 @@ Anonymous external hyperlink target: .. __: http://w3c.org/ """, """\ -<document> +<document source="test data"> <paragraph> Anonymous external hyperlink target: <target anonymous="1" id="id1" refuri="http://w3c.org/"> @@ -354,7 +354,7 @@ Anonymous external hyperlink target: __ http://w3c.org/ """, """\ -<document> +<document source="test data"> <paragraph> Anonymous external hyperlink target: <target anonymous="1" id="id1" refuri="http://w3c.org/"> @@ -365,7 +365,7 @@ Anonymous indirect hyperlink target: .. __: reference_ """, """\ -<document> +<document source="test data"> <paragraph> Anonymous indirect hyperlink target: <target anonymous="1" id="id1" refname="reference"> @@ -378,7 +378,7 @@ __ `a very long reference`_ """, """\ -<document> +<document source="test data"> <paragraph> Anonymous indirect hyperlink targets: <target anonymous="1" id="id1" refname="reference"> @@ -400,14 +400,14 @@ __ reference_ no blank line """, """\ -<document> +<document source="test data"> <paragraph> Mixed anonymous & named indirect hyperlink targets: <target anonymous="1" id="id1" refname="reference"> <target anonymous="1" id="id2" refname="reference"> <target anonymous="1" id="id3" refname="reference"> <target id="target1" name="target1" refname="reference"> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 7. <paragraph> @@ -416,7 +416,7 @@ no blank line <target anonymous="1" id="id4" refname="reference"> <target anonymous="1" id="id5" refname="reference"> <target anonymous="1" id="id6" refname="reference"> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Explicit markup ends without a blank line; unexpected unindent at line 13. <paragraph> diff --git a/docutils/test/test_parsers/test_rst/test_transitions.py b/docutils/test/test_parsers/test_rst/test_transitions.py index acb9b0ab2..14449134b 100755 --- a/docutils/test/test_parsers/test_rst/test_transitions.py +++ b/docutils/test/test_parsers/test_rst/test_transitions.py @@ -30,7 +30,7 @@ Test transition markers. Paragraph """, """\ -<document> +<document source="test data"> <paragraph> Test transition markers. <transition> @@ -51,7 +51,7 @@ Section 2 Paragraph 2 in section 2. """, """\ -<document> +<document source="test data"> <section id="section-1" name="section 1"> <title> Section 1 @@ -86,8 +86,8 @@ may not end with a transition. -------- """, """\ -<document> - <system_message level="3" type="ERROR"> +<document source="test data"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Document or section may not begin with a transition (line 1). <transition> @@ -97,11 +97,11 @@ may not end with a transition. The DTD specifies that two transitions may not be adjacent: <transition> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> At least one body element must separate transitions; adjacent transitions at line 10. <transition> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> At least one body element must separate transitions; adjacent transitions at line 12. <transition> @@ -109,7 +109,7 @@ may not end with a transition. The DTD also specifies that a section or document may not end with a transition. <transition> - <system_message level="3" type="ERROR"> + <system_message level="3" source="test data" type="ERROR"> <paragraph> Document or section may not end with a transition (line 17). """], @@ -123,16 +123,16 @@ Test unexpected transition markers. Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Test unexpected transition markers. <block_quote> <paragraph> Block quote. - <system_message level="4" type="SEVERE"> + <system_message level="4" source="test data" type="SEVERE"> <paragraph> Unexpected section title or transition at line 5. - <literal_block> + <literal_block xml:space="1"> -------- <paragraph> Paragraph. diff --git a/docutils/test/test_readers/test_pep/test_inline_markup.py b/docutils/test/test_readers/test_pep/test_inline_markup.py index a21b755c8..2096ee969 100644 --- a/docutils/test/test_readers/test_pep/test_inline_markup.py +++ b/docutils/test/test_readers/test_pep/test_inline_markup.py @@ -27,7 +27,7 @@ See PEP 287 (pep-0287.txt), and RFC 2822 (which obsoletes RFC822 and RFC-733). """, """\ -<document> +<document source="test data"> <paragraph> See \n\ <reference refuri="pep-0287.html"> @@ -57,7 +57,7 @@ RFC 2822 """, """\ -<document> +<document source="test data"> <paragraph> References split across lines: <paragraph> @@ -75,7 +75,7 @@ Test PEP-specific implicit references before a URL: PEP 287 (http://www.python.org/peps/pep-0287.html), RFC 2822. """, """\ -<document> +<document source="test data"> <paragraph> Test PEP-specific implicit references before a URL: <paragraph> @@ -99,7 +99,7 @@ For *completeness*, _`let's` ``test`` **other** forms_ .. [*] See http://docutils.sf.net/spec/rst/reStructuredText.html. """, """\ -<document> +<document source="test data"> <paragraph> For \n\ <emphasis> diff --git a/docutils/test/test_readers/test_pep/test_rfc2822.py b/docutils/test/test_readers/test_pep/test_rfc2822.py index 818e66412..7cd5a733b 100644 --- a/docutils/test/test_readers/test_pep/test_rfc2822.py +++ b/docutils/test/test_readers/test_pep/test_rfc2822.py @@ -26,7 +26,7 @@ Version: 1 Date: 2002-04-23 """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -57,7 +57,7 @@ Date: 2002-04-23 .. Leading blank lines don't affect RFC-2822 header parsing. """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -77,7 +77,7 @@ Date: 2002-04-23 <field_body> <paragraph> 2002-04-23 - <comment> + <comment xml:space="1"> Leading blank lines don't affect RFC-2822 header parsing. """], ["""\ @@ -88,8 +88,8 @@ Version: 1 Date: 2002-04-23 """, """\ -<document> - <comment> +<document source="test data"> + <comment xml:space="1"> A comment should prevent RFC-2822 header parsing. <paragraph> Author: Me @@ -103,7 +103,7 @@ Version: 1 Date: 2002-04-23 """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -120,13 +120,13 @@ field: empty item above, no blank line """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> field <field_body> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> RFC2822-style field list ends without a blank line; unexpected unindent at line 2. <paragraph> @@ -141,7 +141,7 @@ Date: 2002-04-23 """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -172,7 +172,7 @@ Date: 2002-04-23 (Tuesday) """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -207,7 +207,7 @@ Date: 2002-04-23 (Tuesday) """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> @@ -239,7 +239,7 @@ Authors: - Me Version: """, """\ -<document> +<document source="test data"> <field_list class="rfc2822"> <field> <field_name> diff --git a/docutils/test/test_transforms/test_contents.py b/docutils/test/test_transforms/test_contents.py index 94f1a8c4b..52ac1e079 100755 --- a/docutils/test/test_transforms/test_contents.py +++ b/docutils/test/test_transforms/test_contents.py @@ -46,7 +46,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <topic class="contents" id="contents" name="contents"> <title> Contents @@ -102,7 +102,7 @@ Title 2 Paragraph 2. """, """\ -<document> +<document source="test data"> <topic class="contents" id="table-of-contents" name="table of contents"> <title> Table of Contents @@ -141,7 +141,7 @@ Paragraph 2. .. |Title 2| image:: title2.png """, """\ -<document> +<document source="test data"> <topic class="contents" id="there-s-an-image-in-title-2" name="there's an image in title 2"> <title> There's an image in Title 2 @@ -188,7 +188,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <topic class="contents" id="contents" name="contents"> <title> Contents @@ -249,7 +249,7 @@ Title 4 Paragraph 4. """, """\ -<document> +<document source="test data"> <section id="title-1" name="title 1"> <title> Title 1 @@ -297,7 +297,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <bullet_list> <list_item> @@ -321,7 +321,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <title> Contents @@ -345,7 +345,7 @@ Contents Paragraph. """, """\ -<document> +<document source="test data"> <topic class="contents" id="id1"> <title> Contents @@ -366,7 +366,7 @@ Paragraph. Degenerate case, no table of contents generated. """, """\ -<document> +<document source="test data"> <paragraph> Degenerate case, no table of contents generated. """], diff --git a/docutils/test/test_transforms/test_docinfo.py b/docutils/test/test_transforms/test_docinfo.py index 9c74cbfed..bfc1a2ad2 100755 --- a/docutils/test/test_transforms/test_docinfo.py +++ b/docutils/test/test_transforms/test_docinfo.py @@ -38,7 +38,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ :Parameter i: integer """, """\ -<document> +<document source="test data"> <docinfo> <author> Me @@ -61,7 +61,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ There can only be one abstract. <paragraph> It is automatically moved to the end of the other bibliographic elements. - <comment> + <comment xml:space="1"> Bibliographic element extraction. """], ["""\ @@ -69,6 +69,8 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ :Abstract: Abstract 1. :Author: Me +:Address: 123 My Street + Example, EX :Contact: me@my.org :Version: 1 :Abstract: Abstract 2 (should generate a warning). @@ -76,10 +78,13 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ :Parameter i: integer """, """\ -<document> +<document source="test data"> <docinfo> <author> Me + <address xml:space="1"> + 123 My Street + Example, EX <contact> <reference refuri="mailto:me@my.org"> me@my.org @@ -91,7 +96,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ <field_body> <paragraph> Abstract 2 (should generate a warning). - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> There can only be one "Abstract" field. <date> @@ -109,7 +114,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ Abstract <paragraph> Abstract 1. - <comment> + <comment xml:space="1"> Bibliographic element extraction. """], ["""\ @@ -123,7 +128,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ .. and not empty either """, """\ -<document> +<document source="test data"> <docinfo> <field> <field_name> @@ -133,7 +138,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ <list_item> <paragraph> must be a paragraph - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Cannot extract bibliographic field "Author" containing anything other than a single paragraph. <status> @@ -149,17 +154,17 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ But only one <paragraph> paragraph. - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Cannot extract compound bibliographic field "Date". <field> <field_name> Version <field_body> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Version". - <comment> + <comment xml:space="1"> and not empty either """], ["""\ @@ -176,7 +181,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ - Third """, """\ -<document> +<document source="test data"> <docinfo> <authors> <author> @@ -213,7 +218,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ :Authors: One, Only; """, """\ -<document> +<document source="test data"> <docinfo> <author> Only One @@ -241,13 +246,13 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ Two """, """\ -<document> +<document source="test data"> <docinfo> <field> <field_name> Authors <field_body> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Authors". <field> @@ -261,7 +266,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ <list_item> <paragraph> Two - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. <field> @@ -271,7 +276,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ <bullet_list bullet="-"> <list_item> <list_item> - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. <field> @@ -284,7 +289,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ One <paragraph> Two - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. <field> @@ -297,7 +302,7 @@ totest['bibliographic_field_lists'] = ((DocInfo,), [ One <paragraph> Two - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. """], @@ -313,13 +318,13 @@ checked in to CVS, so the test's expected output text has to be derived (hacked) in parallel in order to stay in sync. """, """\ -<document> +<document source="test data"> <docinfo> <status> test_docinfo.py <date> %s - <comment> + <comment xml:space="1"> RCS keyword extraction. <paragraph> RCS keyword 'RCSfile' doesn't change unless the file name changes, diff --git a/docutils/test/test_transforms/test_doctitle.py b/docutils/test/test_transforms/test_doctitle.py index 0040e54e6..a5c71f043 100755 --- a/docutils/test/test_transforms/test_doctitle.py +++ b/docutils/test/test_transforms/test_doctitle.py @@ -33,10 +33,10 @@ Title Paragraph. """, """\ -<document id="title" name="title"> +<document id="title" name="title" source="test data"> <title> Title - <comment> + <comment xml:space="1"> test title promotion <paragraph> Paragraph. @@ -47,7 +47,7 @@ Title Paragraph (no blank line). """, """\ -<document id="title" name="title"> +<document id="title" name="title" source="test data"> <title> Title <paragraph> @@ -62,7 +62,7 @@ Title Paragraph. """, """\ -<document> +<document source="test data"> <paragraph> Paragraph. <section id="title" name="title"> @@ -81,7 +81,7 @@ Subtitle Test title & subtitle. """, """\ -<document id="title" name="title"> +<document id="title" name="title" source="test data"> <title> Title <subtitle id="subtitle" name="subtitle"> @@ -96,13 +96,13 @@ Title Test short underline. """, """\ -<document id="title" name="title"> +<document id="title" name="title" source="test data"> <title> Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Title underline too short at line 2. - <literal_block> + <literal_block xml:space="1"> Title ==== <paragraph> @@ -118,13 +118,13 @@ The system_message should move after the document title (it was before the beginning of the section). """, """\ -<document id="long-title" name="long title"> +<document id="long-title" name="long title" source="test data"> <title> Long Title - <system_message level="2" type="WARNING"> + <system_message level="2" source="test data" type="WARNING"> <paragraph> Title overline too short at line 1. - <literal_block> + <literal_block xml:space="1"> ======= Long Title ======= @@ -149,10 +149,10 @@ Title 3 Paragraph 3. """, """\ -<document id="title-1" name="title 1"> +<document id="title-1" name="title 1" source="test data"> <title> Title 1 - <comment> + <comment xml:space="1"> Test multiple second-level titles. <paragraph> Paragraph 1. diff --git a/docutils/test/test_transforms/test_filter.py b/docutils/test/test_transforms/test_filter.py index 8417b750e..7feee25cd 100644 --- a/docutils/test/test_transforms/test_filter.py +++ b/docutils/test/test_transforms/test_filter.py @@ -30,7 +30,7 @@ totest['meta'] = ((FirstWriterPending,), [ :keywords: plaintext,markup language """, """\ -<document> +<document source="test data"> <meta content="The reStructuredText plaintext markup language" name="description"> <meta content="plaintext,markup language" name="keywords"> """], diff --git a/docutils/test/test_transforms/test_final_checks.py b/docutils/test/test_transforms/test_final_checks.py index 8b288368c..e1cc61850 100755 --- a/docutils/test/test_transforms/test_final_checks.py +++ b/docutils/test/test_transforms/test_final_checks.py @@ -28,13 +28,13 @@ totest['final_checks'] = ((FinalChecks,), [ Unknown reference_. """, """\ -<document> +<document source="test data"> <paragraph> Unknown \n\ <problematic id="id2" refid="id1"> reference_ . - <system_message backrefs="id2" id="id1" level="3" type="ERROR"> + <system_message backrefs="id2" id="id1" level="3" source="test data" type="ERROR"> <paragraph> Unknown target name: "reference". """], diff --git a/docutils/test/test_transforms/test_footnotes.py b/docutils/test/test_transforms/test_footnotes.py index 9a3c09aa5..2a1ac150f 100755 --- a/docutils/test/test_transforms/test_footnotes.py +++ b/docutils/test/test_transforms/test_footnotes.py @@ -30,7 +30,7 @@ totest['footnotes'] = ((Footnotes,), [ .. [#autolabel] text """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1" refid="autolabel"> 1 @@ -46,7 +46,7 @@ autonumber: [#]_ .. [#] text """, """\ -<document> +<document source="test data"> <paragraph> autonumber: \n\ <footnote_reference auto="1" id="id1" refid="id2"> @@ -68,7 +68,7 @@ autonumber: [#]_ [#]_ is the third auto-numbered footnote reference. """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1" refid="id3"> 1 @@ -111,7 +111,7 @@ Here are some internal cross-references to the implicit targets generated by the footnotes: first_, second_, third_. """, """\ -<document> +<document source="test data"> <paragraph> <footnote_reference auto="1" id="id1" refid="third"> 3 @@ -169,7 +169,7 @@ Mixed anonymous and labelled auto-numbered footnotes: .. [#five] Auto-numbered footnote 5 again (duplicate). """, """\ -<document> +<document source="test data"> <paragraph> Mixed anonymous and labelled auto-numbered footnotes: <paragraph> @@ -218,12 +218,12 @@ Mixed anonymous and labelled auto-numbered footnotes: <footnote auto="1" dupname="five" id="id9"> <label> 6 - <system_message backrefs="id9" level="2" type="WARNING"> + <system_message backrefs="id9" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "five". <paragraph> Auto-numbered footnote 5 again (duplicate). - <system_message backrefs="id11" id="id10" level="3" type="ERROR"> + <system_message backrefs="id11" id="id10" level="3" source="test data" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. """], @@ -235,7 +235,7 @@ Mixed auto-numbered and manual footnotes: .. [#label] autonumber-labeled """, """\ -<document> +<document source="test data"> <paragraph> Mixed auto-numbered and manual footnotes: <footnote id="id1" name="1"> @@ -265,7 +265,7 @@ An unlabeled autonumbered footnote referece: [#]_. order as the references. """, """\ -<document> +<document source="test data"> <paragraph> A labeled autonumbered footnote referece: \n\ <footnote_reference auto="1" id="id1" refid="footnote"> @@ -307,7 +307,7 @@ and labelled auto-numbered footnotes: .. [#five] Auto-numbered footnote 5 again (duplicate). """, """\ -<document> +<document source="test data"> <paragraph> Mixed manually-numbered, anonymous auto-numbered, and labelled auto-numbered footnotes: @@ -367,12 +367,12 @@ and labelled auto-numbered footnotes: <footnote auto="1" dupname="five" id="id13"> <label> 7 - <system_message backrefs="id13" level="2" type="WARNING"> + <system_message backrefs="id13" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "five". <paragraph> Auto-numbered footnote 5 again (duplicate). - <system_message backrefs="id15" id="id14" level="3" type="ERROR"> + <system_message backrefs="id15" id="id14" level="3" source="test data" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. """], @@ -382,7 +382,7 @@ Referencing a footnote by symbol [*]_. .. [*] This is an auto-symbol footnote. """, """\ -<document> +<document source="test data"> <paragraph> Referencing a footnote by symbol \n\ <footnote_reference auto="*" id="id1" refid="id2"> @@ -412,7 +412,7 @@ A sequence of symbol footnote references: .. [*] Auto-symbol footnote 12. """, u"""\ -<document> +<document source="test data"> <paragraph> A sequence of symbol footnote references: <footnote_reference auto="*" id="id1" refid="id13"> diff --git a/docutils/test/test_transforms/test_hyperlinks.py b/docutils/test/test_transforms/test_hyperlinks.py index b0f930de6..32ecc182d 100755 --- a/docutils/test/test_transforms/test_hyperlinks.py +++ b/docutils/test/test_transforms/test_hyperlinks.py @@ -32,7 +32,7 @@ direct_ external .. _direct: http://direct """, """\ -<document> +<document source="test data"> <paragraph> <reference refuri="http://direct"> direct @@ -46,7 +46,7 @@ indirect_ external .. _xtarget: http://indirect """, """\ -<document> +<document source="test data"> <paragraph> <reference refuri="http://indirect"> indirect @@ -60,7 +60,7 @@ indirect_ external direct_ internal """, """\ -<document> +<document source="test data"> <target id="direct" name="direct"> <paragraph> <reference refid="direct"> @@ -76,7 +76,7 @@ indirect_ internal .. _indirect: indirect2_ """, """\ -<document> +<document source="test data"> <target id="ztarget" name="ztarget"> <paragraph> <reference refid="ztarget"> @@ -94,7 +94,7 @@ indirect_ internal .. _indirect: implicit_ """, """\ -<document> +<document source="test data"> <section id="implicit" name="implicit"> <title> Implicit @@ -118,7 +118,7 @@ indirect_ internal .. _indirect: implicit_ """, """\ -<document> +<document source="test data"> <section dupname="implicit" id="implicit"> <title> Implicit @@ -127,7 +127,7 @@ indirect_ internal <section dupname="implicit" id="id1"> <title> Implicit - <system_message backrefs="id1" level="1" type="INFO"> + <system_message backrefs="id1" level="1" source="test data" type="INFO"> <paragraph> Duplicate implicit target name: "implicit". <paragraph> @@ -135,7 +135,7 @@ indirect_ internal indirect_ internal <target id="indirect" name="indirect" refname="implicit"> - <system_message backrefs="id3" id="id2" level="2" type="WARNING"> + <system_message backrefs="id3" id="id2" level="2" source="test data" type="WARNING"> <paragraph> Indirect hyperlink target "indirect" (id="indirect") refers to target "implicit", which does not exist. """], @@ -145,7 +145,7 @@ indirect_ internal __ http://direct """, """\ -<document> +<document source="test data"> <paragraph> <reference anonymous="1" refuri="http://direct"> direct external @@ -158,7 +158,7 @@ __ xtarget_ .. _xtarget: http://indirect """, """\ -<document> +<document source="test data"> <paragraph> <reference anonymous="1" refuri="http://indirect"> indirect external @@ -171,7 +171,7 @@ __ `direct internal`__ """, """\ -<document> +<document source="test data"> <target anonymous="1" id="id1"> <paragraph> <reference anonymous="1" refid="id1"> @@ -185,7 +185,7 @@ __ __ ztarget_ """, """\ -<document> +<document source="test data"> <target id="ztarget" name="ztarget"> <paragraph> <reference anonymous="1" refid="ztarget"> @@ -206,11 +206,11 @@ Second __ ztarget_ """, """\ -<document> +<document source="test data"> <target dupname="ztarget" id="ztarget"> <paragraph> First - <system_message backrefs="id1" level="2" type="WARNING"> + <system_message backrefs="id1" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "ztarget". <target dupname="ztarget" id="id1"> @@ -220,7 +220,7 @@ __ ztarget_ <problematic id="id4" refid="id3"> `indirect internal`__ <target anonymous="1" id="id2" refname="ztarget"> - <system_message backrefs="id4" id="id3" level="2" type="WARNING"> + <system_message backrefs="id4" id="id3" level="2" source="test data" type="WARNING"> <paragraph> Indirect hyperlink target (id="id2") refers to target "ztarget", which does not exist. """], @@ -235,7 +235,7 @@ This paragraph referenced. By this `internal hyperlink`_ referemce. """, """\ -<document> +<document source="test data"> <target id="internal-hyperlink" name="internal hyperlink"> <paragraph> This paragraph referenced. @@ -257,7 +257,7 @@ as well as by this chained_ reference. The results of the transform are not visible at the XML level. """, """\ -<document> +<document source="test data"> <target id="chained" name="chained"> <target id="internal-hyperlink" name="internal hyperlink"> <paragraph> @@ -280,7 +280,7 @@ The results of the transform are not visible at the XML level. `External hyperlink`_ reference. """, """\ -<document> +<document source="test data"> <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> @@ -292,10 +292,10 @@ The results of the transform are not visible at the XML level. .. _indirect target: `external hyperlink`_ """, """\ -<document> +<document source="test data"> <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <target id="indirect-target" name="indirect target" refuri="http://uri"> - <system_message level="1" type="INFO"> + <system_message level="1" source="test data" type="INFO"> <paragraph> Indirect hyperlink target "indirect target" is not referenced. """], @@ -307,7 +307,7 @@ The results of the transform are not visible at the XML level. and a chained_ reference too. """, """\ -<document> +<document source="test data"> <target id="chained" name="chained" refuri="http://uri"> <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <paragraph> @@ -326,7 +326,7 @@ and a chained_ reference too. `Indirect hyperlink`_ reference. """, """\ -<document> +<document source="test data"> <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> <paragraph> @@ -342,7 +342,7 @@ and a chained_ reference too. Chained_ `indirect hyperlink`_ reference. """, """\ -<document> +<document source="test data"> <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <target id="chained" name="chained" refuri="http://uri"> <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> @@ -369,7 +369,7 @@ __ `internal anonymous hyperlink reference`__. """, """\ -<document> +<document source="test data"> <target anonymous="1" id="id1" refuri="http://full"> <target anonymous="1" id="id2" refuri="http://simplified"> <target anonymous="1" id="id3" refuri="http://simplified"> @@ -401,14 +401,14 @@ Duplicate external target_'s (different URIs): .. _target: second """, """\ -<document> +<document source="test data"> <paragraph> Duplicate external \n\ <reference refname="target"> target 's (different URIs): <target dupname="target" id="target" refuri="first"> - <system_message backrefs="id1" level="2" type="WARNING"> + <system_message backrefs="id1" level="2" source="test data" type="WARNING"> <paragraph> Duplicate explicit target name: "target". <target dupname="target" id="id1" refuri="second"> @@ -419,7 +419,7 @@ Several__ anonymous__ hyperlinks__, but not enough targets. __ http://example.org """, """\ -<document> +<document source="test data"> <paragraph> <problematic id="id3" refid="id2"> Several__ @@ -431,7 +431,7 @@ __ http://example.org hyperlinks__ , but not enough targets. <target anonymous="1" id="id1" refuri="http://example.org"> - <system_message backrefs="id3 id4 id5" id="id2" level="3" type="ERROR"> + <system_message backrefs="id3 id4 id5" id="id2" level="3" source="test data" type="ERROR"> <paragraph> Anonymous hyperlink mismatch: 3 references but 1 targets. """], diff --git a/docutils/test/test_transforms/test_messages.py b/docutils/test/test_transforms/test_messages.py index d6912d16e..56cc3725d 100755 --- a/docutils/test/test_transforms/test_messages.py +++ b/docutils/test/test_transforms/test_messages.py @@ -34,7 +34,7 @@ generate a "System Messages" section. document by the test framework.) """, """\ -<document> +<document source="test data"> <paragraph> This \n\ <problematic id="id2" refid="id1"> @@ -54,7 +54,7 @@ document by the test framework.) <section class="system-messages"> <title> Docutils System Messages - <system_message backrefs="id2" id="id1" level="3" type="ERROR"> + <system_message backrefs="id2" id="id1" level="3" source="test data" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown substitution". """], diff --git a/docutils/test/test_transforms/test_sectnum.py b/docutils/test/test_transforms/test_sectnum.py index 1b0ce4c2f..da916dc8e 100644 --- a/docutils/test/test_transforms/test_sectnum.py +++ b/docutils/test/test_transforms/test_sectnum.py @@ -48,7 +48,7 @@ Title 4 Paragraph 4. """, u"""\ -<document> +<document source="test data"> <section id="title-1" name="title 1"> <title auto="1"> <generated class="sectnum"> @@ -86,7 +86,7 @@ u"""\ Paragraph 1. """, u"""\ -<document> +<document source="test data"> <section id="bold-title" name="bold title"> <title auto="1"> <generated class="sectnum"> @@ -116,7 +116,7 @@ Title 4 Paragraph 4. """, u"""\ -<document> +<document source="test data"> <section id="title-1" name="title 1"> <title auto="1"> <generated class="sectnum"> @@ -165,7 +165,7 @@ Title 4 Paragraph 4. """, u"""\ -<document> +<document source="test data"> <topic class="contents" id="contents" name="contents"> <title> Contents diff --git a/docutils/test/test_transforms/test_substitutions.py b/docutils/test/test_transforms/test_substitutions.py index f1cd8aece..763cd8311 100755 --- a/docutils/test/test_transforms/test_substitutions.py +++ b/docutils/test/test_transforms/test_substitutions.py @@ -30,7 +30,7 @@ The |biohazard| symbol is deservedly scary-looking. .. |biohazard| image:: biohazard.png """, """\ -<document> +<document source="test data"> <paragraph> The \n\ <image alt="biohazard" uri="biohazard.png"> @@ -42,13 +42,13 @@ The |biohazard| symbol is deservedly scary-looking. Here's an |unknown| substitution. """, """\ -<document> +<document source="test data"> <paragraph> Here's an \n\ <problematic id="id2" refid="id1"> |unknown| substitution. - <system_message backrefs="id2" id="id1" level="3" type="ERROR"> + <system_message backrefs="id2" id="id1" level="3" source="test data" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown". """], diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 8383d49a1..cb4293196 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -19,7 +19,7 @@ from DocutilsTestSupport import utils, nodes class ReporterTests(unittest.TestCase): stream = StringIO.StringIO() - reporter = utils.Reporter(2, 4, stream, 1) + reporter = utils.Reporter('test data', 2, 4, stream, 1) def setUp(self): self.stream.seek(0) @@ -28,17 +28,17 @@ class ReporterTests(unittest.TestCase): def test_level0(self): sw = self.reporter.system_message(0, 'debug output') self.assertEquals(sw.pformat(), """\ -<system_message level="0" type="DEBUG"> +<system_message level="0" source="test data" type="DEBUG"> <paragraph> debug output """) self.assertEquals(self.stream.getvalue(), - 'Reporter: DEBUG (0) debug output\n') + 'Reporter: DEBUG/0 (test data) debug output\n') def test_level1(self): sw = self.reporter.system_message(1, 'a little reminder') self.assertEquals(sw.pformat(), """\ -<system_message level="1" type="INFO"> +<system_message level="1" source="test data" type="INFO"> <paragraph> a little reminder """) @@ -47,34 +47,34 @@ class ReporterTests(unittest.TestCase): def test_level2(self): sw = self.reporter.system_message(2, 'a warning') self.assertEquals(sw.pformat(), """\ -<system_message level="2" type="WARNING"> +<system_message level="2" source="test data" type="WARNING"> <paragraph> a warning """) self.assertEquals(self.stream.getvalue(), - 'Reporter: WARNING (2) a warning\n') + 'Reporter: WARNING/2 (test data) a warning\n') def test_level3(self): sw = self.reporter.system_message(3, 'an error') self.assertEquals(sw.pformat(), """\ -<system_message level="3" type="ERROR"> +<system_message level="3" source="test data" type="ERROR"> <paragraph> an error """) self.assertEquals(self.stream.getvalue(), - 'Reporter: ERROR (3) an error\n') + 'Reporter: ERROR/3 (test data) an error\n') def test_level4(self): self.assertRaises(utils.SystemMessage, self.reporter.system_message, 4, 'a severe error, raises an exception') - self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE (4) ' + self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE/4 (test data) ' 'a severe error, raises an exception\n') class QuietReporterTests(unittest.TestCase): stream = StringIO.StringIO() - reporter = utils.Reporter(5, 5, stream, 0) + reporter = utils.Reporter('test data', 5, 5, stream, 0) def setUp(self): self.stream.seek(0) @@ -83,7 +83,7 @@ class QuietReporterTests(unittest.TestCase): def test_debug(self): sw = self.reporter.debug('a debug message') self.assertEquals(sw.pformat(), """\ -<system_message level="0" type="DEBUG"> +<system_message level="0" source="test data" type="DEBUG"> <paragraph> a debug message """) @@ -92,7 +92,7 @@ class QuietReporterTests(unittest.TestCase): def test_info(self): sw = self.reporter.info('an informational message') self.assertEquals(sw.pformat(), """\ -<system_message level="1" type="INFO"> +<system_message level="1" source="test data" type="INFO"> <paragraph> an informational message """) @@ -101,7 +101,7 @@ class QuietReporterTests(unittest.TestCase): def test_warning(self): sw = self.reporter.warning('a warning') self.assertEquals(sw.pformat(), """\ -<system_message level="2" type="WARNING"> +<system_message level="2" source="test data" type="WARNING"> <paragraph> a warning """) @@ -110,7 +110,7 @@ class QuietReporterTests(unittest.TestCase): def test_error(self): sw = self.reporter.error('an error') self.assertEquals(sw.pformat(), """\ -<system_message level="3" type="ERROR"> +<system_message level="3" source="test data" type="ERROR"> <paragraph> an error """) @@ -119,7 +119,7 @@ class QuietReporterTests(unittest.TestCase): def test_severe(self): sw = self.reporter.severe('a severe error') self.assertEquals(sw.pformat(), """\ -<system_message level="4" type="SEVERE"> +<system_message level="4" source="test data" type="SEVERE"> <paragraph> a severe error """) @@ -133,7 +133,7 @@ class ReporterCategoryTests(unittest.TestCase): def setUp(self): self.stream.seek(0) self.stream.truncate() - self.reporter = utils.Reporter(2, 4, self.stream, 1) + self.reporter = utils.Reporter('test data', 2, 4, self.stream, 1) self.reporter.set_conditions('lemon', 1, 3, self.stream, 0) def test_getset(self): @@ -163,7 +163,7 @@ class ReporterCategoryTests(unittest.TestCase): self.assertEquals(self.stream.getvalue(), '') sw = self.reporter.debug('debug output') self.assertEquals(self.stream.getvalue(), - 'Reporter: DEBUG (0) debug output\n') + 'Reporter: DEBUG/0 (test data) debug output\n') def test_info(self): sw = self.reporter.info('some info') @@ -171,39 +171,39 @@ class ReporterCategoryTests(unittest.TestCase): sw = self.reporter.info('some info', category='lemon.curry') self.assertEquals( self.stream.getvalue(), - 'Reporter "lemon.curry": INFO (1) some info\n') + 'Reporter "lemon.curry": INFO/1 (test data) some info\n') def test_warning(self): sw = self.reporter.warning('a warning') self.assertEquals(self.stream.getvalue(), - 'Reporter: WARNING (2) a warning\n') + 'Reporter: WARNING/2 (test data) a warning\n') sw = self.reporter.warning('a warning', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ -Reporter: WARNING (2) a warning -Reporter "lemon.curry": WARNING (2) a warning +Reporter: WARNING/2 (test data) a warning +Reporter "lemon.curry": WARNING/2 (test data) a warning """) def test_error(self): sw = self.reporter.error('an error') self.assertEquals(self.stream.getvalue(), - 'Reporter: ERROR (3) an error\n') + 'Reporter: ERROR/3 (test data) an error\n') self.assertRaises(utils.SystemMessage, self.reporter.error, 'an error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ -Reporter: ERROR (3) an error -Reporter "lemon.curry": ERROR (3) an error +Reporter: ERROR/3 (test data) an error +Reporter "lemon.curry": ERROR/3 (test data) an error """) def test_severe(self): self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error') self.assertEquals(self.stream.getvalue(), - 'Reporter: SEVERE (4) a severe error\n') + 'Reporter: SEVERE/4 (test data) a severe error\n') self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ -Reporter: SEVERE (4) a severe error -Reporter "lemon.curry": SEVERE (4) a severe error +Reporter: SEVERE/4 (test data) a severe error +Reporter "lemon.curry": SEVERE/4 (test data) a severe error """) diff --git a/docutils/tools/quicktest.py b/docutils/tools/quicktest.py index 133cfc815..2f0c46454 100755 --- a/docutils/tools/quicktest.py +++ b/docutils/tools/quicktest.py @@ -190,7 +190,7 @@ def main(): options.debug = optargs['debug'] parser = Parser() input = inputFile.read() - document = new_document(options) + document = new_document(inputFile.name, options) parser.parse(input, document) output = format(outputFormat, input, document, optargs) outputFile.write(output) |
