| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
Also, use Unicode literals for Umlauts.
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9268 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In rST, the location of images and figures is specified as URI
and used literally. As a consequence, finding a corresponding
image file in the local filesystem depends on the current working
directory. The tests are designed to work if the cwd is the test root.
As only files that are actually found are written to the "dependencies",
we disable the tests for image file registry if cwd != test root.
Also, use "pathlib.Path" for simpler path manipulations.
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9267 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
A name mismatch occured during the test refactoring which
prevented deleting a test sample requiring "pygments".
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9266 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean the global caches to ensure predictable test results.
(There were additional warnings for undefined directive and
role names under Windows. These were suppressed due to other
tests adding canonical names to the cache under Linux.)
Add additional warnings to the expected output samples.
Registering directives at test module level no longer works.
Move `register_directive()` call to the test function.
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9265 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
| |
Skipping the complete test directory does not work with "alltests.py".
Also fix running the individual tests scripts.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9264 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After test refactoring, test scripts failed with ImportError
unless started from the "test root" ``docutils/test/``.
Prepend the "docutils root" to the Python library path
so we import the local `docutils` and `test` packages,
ignoring an eventually installed Docutils package.
Set executable bit where this was missing.
Also:
Use "pathlib" instead of "os.path" for self-documenting path manipulations.
Remove duplicate ``import unittest`` statements.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9263 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
When a test fails, only the first line of the failing statement is printed.
Writing the statements that should be equal just behind the function name,
we can see which argument is the actual "output" and which is
the "expected" value if the assertment fails.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9262 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
| |
This fixes a leftover from the times Python did not have a `bool` datatype.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9257 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
Define common defaults for all functional tests in `test_functional.py`.
Only specify settings that differ from the default/fallback value
in the individual test files.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9249 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use utils.xml_declaration().
Don't write charset (encoding) declaration if the intended output encoding
is not known.
Copy "meta" part content into "head" in `depart_document()`
(i.e. after collecting all items).
Obsoletes auxiliary method `add_meta()`. Remove it.
Changes to the HTML output (no space character before closing tag of XML
declaration, order of metadata elements) don't affect the HTML semantics,
styling, and rendering.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9240 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
Return XML text declaration.
Include an encoding declaration if the intended encoding is known.
Used in XML (and soon also in HTML) writer.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9239 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is the minimal configuration required for the test suite to
pass using the pytest framework. This is part of the test suite
refactoring project.
- Ignore two classes that start with the word "Test"
- Provide the standard test header to pytest
- Update the documentation
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9237 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, the test suite only worked when the current working
directory was ``docutils/test/`. With this change all relative paths
are calculated explicitly such that the working directory no longer
affects the tests, meaning a less fragile test environment and
greater flexibility to use test runners other than ``alltests.py``.
This is part of the test suite refactoring project.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9236 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
API documentation:
- Spell out ampersand (&) as "and".
- Finish description of part "pepnum".
- Add links to LaTeX templates.
- Remove trailing whitespace.
Docstrings:
- Clarify source and output data type for functions using
"string I/O" (with "string" in the general sense of "`str` or `bytes`").
- Recommend using publish_parts() to get Docutils output as `str`.
- Add "()" to functions so that pydoc HTML rendering generates auto-links.
- Add links to the HTML documentation.
Tests:
- Add test for input/output data types of publish_string().
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
- Move all usages of ``testroot`` to defining and using a
``TEST_ROOT`` constant within the module, as part of the test
suite refactoring project
- Avoid ``os.chdir`` calls within ``test_error_reporting``
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9234 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
Tests in ``test_include`` previously only passed when the current
working directory was equal to the test root. This change makes it
possible to run the tests without changing the CWD, as part of the
test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9233 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``exception_data`` to using the ``try`` /
``except`` pattern as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9232 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
This removes the now unused ``StandardTestCase``, ``CustomTestCase``,
and ``CustomTestSuite``.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9231 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``ParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9230 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
- Move all usages of ``TransformTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
- Fix the global state issues with ``test_hyperlinks_de`` and run
the test as part of ``alltests.py``
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9229 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``WriterPublishTestCase`` to using subtests, as
part of the test suite refactoring project.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9228 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``PublishTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9227 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9226 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``PEPParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9225 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``GridTableParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9224 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Move all usages of ``SimpleTableParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9223 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
| |
- Move all usages of ``RecommonmarkParserTestSuite.generateTests``
to using subtests.
- Move the conditional test skipping logic to ``__init__.py`` in
``test_recommonmark``, and move the missing module test from
``test_recommonmark.test_misc`` to ``test_get_parser_class``, as
otherwise the test would never run.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9222 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
Use a simpler sample file for signed UTF-16 input.
Test encoding auto-detection
to ensure it is in sync with encoding handling for the main document.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9220 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
| |
Do not call "inputenc" if the "output-encoding" setting is 'utf-8'.
(UTF-8 is the default encoding for LaTeX2e since 2018.)
Do not call "inputenc" if the "output-encoding" setting is 'unicode':
Docutils returns a `str` instance and does not know which encoding will
be used when the output is written to a file or passed to LaTeX.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9219 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
| |
While setting "output-encoding" to "unicode" ensures that
core.publish_string() returns a `str` instance,
it has also effects an eventual encoding declaration (XML, HTML, LaTeX)
and character conversions (LaTeX).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9218 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
| |
This simplifies logic to use the standard ``open`` function, and
simultaneously refactors usages to the context manager protocol
for more explicit resource management
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9208 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9205 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9204 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9203 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
``docutils.core.publish_string`` uses Python 2 notion of a
bytestring, such that in the general case it returns Python 3's
``bytes`` type. Revision 9167 attempted to address this distinction
by introducing ``publish_bytes`` and changing ``publish_string`` to
always return unicode text data as Python's ``str`` type. This is a
backwards compatibility break, so in this commit we restore the
previous behaviour, whilst simultaneously deprecating support for
returning binary data from the ``docutils.core.publish_string``
function for at least two releases of Docutils.
As part of this, we also deprecate returning binary data from the
``docutils.io.StringOutput.encode`` method, docutils.io.BytesOutput``
should be used in its stead.
Finally, we update tests for the reversion to the previous behaviour.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9202 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9195 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9194 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
Ensure all names are lowercase, and replace all non-alpha characters
with underscores.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9193 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9192 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9191 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9190 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9189 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9188 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9187 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9186 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9185 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9184 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
- Use subtests
- Use standard ``unittest`` assert methods
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9183 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
|
|
|
| |
This was only used in one test and complicated the functional testing
logic. Testing extra items should be done in independent tests.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9182 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
| |
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9181 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|