summaryrefslogtreecommitdiff
path: root/docutils/test
Commit message (Collapse)AuthorAgeFilesLines
* Version 0.20.2b.devgrubert2023-05-1718-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9390 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Release 0.20.1grubert2023-05-1618-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9388 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix false alarm when testing with pypy 3.9.milde2023-05-111-5/+12
| | | | | | | Work around non-standard error message from pypy 3.9. Fixes [bugs:#471]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9384 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix some flake8 warnings in test scripts and remove flake8 exception rules.milde2023-05-102-12/+15
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9378 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* version 0.20.1b.devgrubert2023-05-0918-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9376 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* release 0.20grubert2023-05-0918-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9374 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* version 0.20rc1 grubert2023-05-0418-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9372 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert addition of `io.OutString` and the "auto_encode" argument.milde2023-05-0212-148/+64
| | | | | | | We need a review of the "string output" interface and a consensus on the "clean" end-state before starting with the implementation. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9369 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add output encoding error handler to the parts provided by all writers.milde2023-04-283-0/+3
| | | | | | | | | | | | The new generic part "errors" returned by default contains the `output_encoding_error_handler` setting, which may make-or-break encoding ``parts['whole']``. Allows use of `core.publish_parts()` to get the document as `str`, post-process it and encode with user configurated encoding and encoding-error handler. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9368 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid trailing whitespace in test sample strings.milde2023-04-281-27/+27
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test syntax highlight: Make pygments version parsing more robust.milde2023-04-173-21/+10
| | | | | | | Do not fail for pre-release versions (c.f. https://pygments.org/docs/changelog/). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9355 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Support Pygments 2.14 and newer in testsmilde2023-04-173-0/+278
| | | | | | | | | Pygments 2.14 contains changes in the Python lexer which break ``test_code``​​, ``test_code_long``, and ``test_include``. https://pygments.org/docs/changelog/#version-2-14-0 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9354 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Raise ValueError if StringOutput.write() gets data of unsupported typemilde2023-04-171-4/+2
| | | | | | | | | | | ... instead of returning/storing an "informal string representation". Replaces the test for the "odt" writers" with binary output in `core.publish_programmatically()` with a generic alternative (that also catches the case of the "null" writer instead of writing the string "None"). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9353 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix test failure introduced in [r9348].milde2023-04-171-4/+24
| | | | | | | | | Reword and wrap warning message for incompatible content of the bibliographic field "author". Adapt "frontmatter" unit test cases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9351 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix message for nonconforming docinfo-Authors.grubert2023-04-161-4/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9350 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix test for spurious enumerated lists in bibliographic fields.milde2023-04-141-0/+3
| | | | | | | The test for "single line paragraphs" failed for bibliographic fields followed by an empty line. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix regex to match multiline message "requires ... recommonmark"grubert2023-04-131-1/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not decode OpenDocument zip packages with `publish_string()`.milde2023-04-131-7/+20
| | | | | | | | | | | | | | The ODF writer produces output in binary format. Raise an exception if `publish_string()` is called with this writer and ``auto_encode=False``. Update documentation, add cross-links. TODO: In future, the ODF writer may return a "flat XML" version of the "OpenDocument Text" document as `str`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9345 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "auto_encode" argument to `core.publish_from_doctree()`.milde2023-04-121-8/+11
| | | | | | | publish_from_doctree() output is described as "string" and uses `io.StringOutput` just as publish_string(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9342 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Set "auto_encode=False" to skip en-/decoding output in tests.milde2023-04-1111-55/+60
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9341 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert introduction of `core.publish_bytes()` and `io.BytesOutput`.milde2023-04-084-4/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9339 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "auto_encode" argument to `publish_string()`milde2023-04-062-1/+79
| | | | | | | | | | | | | | | | Add "auto_encode" argument to publish_string() and publish_programmatically() to give the user an option to select the output type (`bytes` or `OutString`) in a way that does not interfere with the intended encoding of the output (the problem with the "dummy" output encoding name ``unicode``). The default will change from ``False`` to ``True`` in Docutils 0.22 New class for `io.StringOutput`: `io.OutString` adds "encoding" and "errors" attributes to `str`. Allows storing the "output_encoding" and "output_encoding_error_handler" settings in a transparent and easy to process way. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9336 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prefer Unix style line endingsaa-turner2023-03-311-28/+28
| | | | | | | | | | | | | | I had inadvertently committed two files with Windows style 'CRLF' (``\r\n``) line endings. This commit changes ``docutils/test/conftest.py`` and ``.gitattributes`` to use Unix style 'LF' (``\n``) endings. We additionally specify that Unix style line endings are only enforced in the ``docutils`` directory, as there are around 20 files in the sandbox that use Windows style line endings, and I don't want to change these at the moment. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9334 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update Flake8 version and resolve lint warningsaa-turner2023-03-251-1/+1
| | | | | | | | | Flake8 6.0.0 introduces a stricter format for parsing ``.flake8`` files, which does not allow comments on the same line as the error code in ``ignore`` sections. For now, update to the last version before 6.0.0. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9331 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use absolute paths in ``test_CLI``aa-turner2023-03-251-2/+4
| | | | | | | | | | | When running tests in working directories other than ``docutils/test``, the tests fail as the expected files cannot be opened from the relative ``./data`` path. This change uses the defined ``DATA_ROOT`` constant so that the tests pass regardless of working directory. We also take the opportunity to explicitly specify the encoding with which to open the file, avoiding platform-dependent behaviour. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9330 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous module name `io`.milde2023-02-071-49/+50
| | | | | | | There are standard `io` and `docutils.io`. Avoid ambiguity by not using ``from docutils import io``. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9329 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New general setting "output".milde2023-02-074-7/+32
| | | | | | | | This setting obsoletes the positional argument <destination>. Cf. the announcement of command line pattern changes in the RELEASE-NOTES. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9328 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New functions for use as `rst2*` "console_scripts entry points".milde2023-02-063-7/+495
| | | | | | | | | | | | | | The new functions allow the installation of `rst2*` command line scripts via standard `entry points`__ instead of the current "scripts" list in ``setup.py`` after a transition period (cf. [feature-requests:#88]). + Works also for Windows. + Allows shorter command names (drop the extension), already in use in Debian and Ubuntu. __ https://packaging.python.org/en/latest/specifications/entry-points/ git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9325 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix test case under Windows, add HISTORY entry for last commit.milde2023-01-171-7/+8
| | | | | | Thanks to Alan Isaac for test and report. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9323 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More user-friendly DocInfo transform.milde2023-01-171-4/+8
| | | | | | | | | | | | | More detailled feedback when extracting data from a bibliographic field fails. In bibliographic fields expecting a single paragraph (e.g. "author"), restore enumerated lists originating in ambiguous markup like "A. Einstein" (name with initial): in the given context, an we know that this should not be an enumeration, so fixing is better than throwing an error. Fix some cases of "ersatz" Boolean values from pre Python 2.3 times. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9322 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix failures when running "transform" test modules as "__main__".milde2023-01-172-40/+33
| | | | | | | | | | | | | | | | | | | | | | | Also restructure `test_docinfo` to reduce code duplication. Running "transform" test modules independently failed due to an additional INFO message: Loading a language module results in an INFO message. Import statements don't trigger the INFO message if the language module is already loaded. When running a test module as __main__, the INFO message is added to the first document using both, the language module and the `Messages` or `TestMessages` transform. When running the test suite, the language module may already be loaded by another test. For stable results, the optional message must be filtered. In "transform" tests, we do not load the default transforms, so INFO messages are only filtered if `FilterMessages` is explicitly added. As `FilterMessages` only acts on attached messages, it must run *after* `TestMessages`, therefore we load it with custom priority 890. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9321 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix and activate test for "parts" published by the LaTeX writer.milde2023-01-161-23/+23
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9317 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Refactor latex writer tests.milde2022-12-192-195/+218
| | | | | | | | | | | | | | | | Define default test settings as class attribute. Use separate test functions for different settings instead of running all sub-test from one function. Simplify naming. Add test for "use_bibtex" setting (will be fixed in next commit). Add stub for testing `core.publish_parts()` with the "latex" writer. (Currently publish_parts does not work with "latex".) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9311 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bugs:#463]. Spurious comma in deprecation warning.milde2022-12-171-0/+5
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9310 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update test documentation. Set executable bit on test scripts.milde2022-12-132-0/+0
| | | | | | | | | | | Don't mention the "nose" test framework. (It is unmaintained, deprecated, and fails to find all test cases.) Hint to a possible future dependency on "pytest". Two recently added test scripts missed the executable bit. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9308 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* remove blanks at eol in code NOT in expectsgrubert2022-12-031-8/+8
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9305 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Allow empty string as encoding value (to re-activate default).milde2022-12-021-1/+3
| | | | | | | | | Value `None` cannot be specified on the command line. Use ``--input-encoding=""`` go back to Docutil's default behaviur (use encoding indicated in the file or fallbacks) if a config file sets "input_encoding" to another value. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9303 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify error message if recommonmark is missing.milde2022-12-021-1/+1
| | | | | | | | | As we provide a mock Sphinx package, there is no need to emphasise recommonmark's dependency on Sphinx. Wrap error message. Adapt the test case. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9302 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip test_recommonmark/ directory if recommonmark is missing.milde2022-12-0214-74/+18
| | | | | | | | | | | After basing "alltests.py" on the `unittest.defaultTestLoader`, we can (again) skip the complete directory from the __init__.py file. Simplify recommonmark test files (when running individually, failing with an ImportError when recommonmark is missing is no problem). Keep the `sys.path` setup, we still want test the local "docutils" package. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9301 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Only extempt sample *.txt files from "trailing whitespace" git pre-commit check.milde2022-12-021-114/+114
| | | | | | | | | | | | Mask trailing whitespace in test_latex2e.py. Replace the generic extemption for '*.txt' with '*pseudoxml.txt'. (Expected output from the "pseudoxml" writer which has trailing whitespace by design.) Also simplify rule after ``prest`` moved to the attic. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9300 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ignore ``frontend.OptionParser`` deprecation warnings in ``HelperFunctionTests``aa-turner2022-12-021-2/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9296 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use unicode literal for U+00E4aa-turner2022-12-021-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9295 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use ``unittest.defaultTestLoader`` to load testsaa-turner2022-12-021-56/+1
| | | | | | This allows raising the ``unittest.SkipTest`` error at the module level git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9294 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5: Use dpub-ARIA role "doc-footnote" for footnotesmilde2022-12-014-39/+39
| | | | | | | | (instead of ARIA role "note"). No change with "html4css1". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9292 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Raise version to 0.20b.dev.milde2022-12-0119-19/+19
| | | | | | There are not only bugfix changes since 0.19, so a new "minor" release is required. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9291 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use pathlib.Path in utils.find_file_in_dirs().milde2022-11-281-7/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9283 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Wrap definition lists with "details" class argument in a <div>milde2022-11-282-0/+6
| | | | | | | | with the "id" and "class" values of the list node. Enables setting an "anchor" or a "class" value for "detail disclosure elments". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9282 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix IndexError when running individual test modules under Python <3.9milde2022-11-26135-137/+139
| | | | | | | | | Up to Python 3.8, __file__ returns a relative path for the main script specified on the command line. Use `Path.resolve()` to make it absolute before calling `Path.parents`. https://docs.python.org/3/whatsnew/3.9.html#other-language-changes git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9277 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix import errors with ``python -m unittest``.milde2022-11-25114-150/+715
| | | | | | | | Running standard unittest on the test suite resulted in 89 ImportErrors because ``import DocutilsTestSupport was used to set up sys.path() but the module could not be found on the original sys.path(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9274 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove spurious "import unittest" from test scripts.milde2022-11-24101-101/+0
| | | | | | | There was a "late" import if __name__ == "__main__" which is no longer required when importing `unittest` at the top. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9269 929543f6-e4f2-0310-98a6-ba3bd3dd1d04