summaryrefslogtreecommitdiff
path: root/docutils/test/test_transforms/test_smartquotes.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix failures when running "transform" test modules as "__main__".milde2023-01-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | 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 IndexError when running individual test modules under Python <3.9milde2022-11-261-1/+1
| | | | | | | | | 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-251-1/+6
| | | | | | | | 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-241-1/+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
* Inline ``TransformTestSuite``aa-turner2022-11-091-20/+72
| | | | | | | | | - 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
* Fix newline problems, further simplify ``compare_output``aa-turner2022-10-211-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9169 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove all ``import __init__`` statements, as part of theaa-turner2022-10-211-2/+0
| | | | | | | unittest migration. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9141 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Import ``DocutilsTestSupport`` from ``test``aa-turner2022-10-211-1/+1
| | | | | | | | | | | | This is the first step of moving to the standard ``unittest`` style. It involves making the ``test/`` directory a psuedo-package and importing the ``DocutilsTestSupport`` module from it, instead of the path manipulation previously carried out in ``__init__.py`` files. As of this, we also blank out all ``__init__.py`` files in the test directories. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9140 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-1/+1
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-1/+1
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warnings W293, W391).milde2022-01-291-2/+2
| | | | | | | W293 blank line contains whitespace W391 blank line at end of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8993 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warning W291).milde2022-01-291-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8992 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-261-13/+13
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-3/+1
| | | | | | Only required with Python 2.x. Encoding in Py3k is utf8 by default. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove 2.7-compatibility __future__ imports.milde2022-01-031-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change default value for the "auto_id_prefix" setting to "%".milde2021-06-181-2/+2
| | | | | | | Auto-generated IDs use the tag name as prefix. Set auto_id_prefix_ to "id" if you want unchanged auto-IDs. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8771 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-041-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8554 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Restore support for running tests stand-alone.milde2020-01-311-1/+1
| | | | | | | | | After the switch to absolute imports, individual test could no longer be run in from their directory (import error). This patch makes the `pythonpath` expansion in the test subdirectories' ``__init__`` files functional again. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8481 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 383 ] Smart quotes around opening and separator characters.milde2020-01-261-13/+32
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8469 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'absolute_import' futuremilde2019-08-261-2/+3
| | | | | | | | This mostly applies to tests. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8356 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-5/+5
| | | | | | | | | | Remove all uses of print as a statement. This includes comments, many of which are simply removed as noise (they're in version control and can be re-added later, if necessary). Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix py38 SyntaxWarning: invalid escape sequence \grubert2019-08-111-4/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8311 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix #332 and #342 (smartquotes problems).milde2019-07-241-9/+116
| | | | | | | Standard backslash escape for smartquotes. No escape in roles descending from `inline literal`. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8301 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert the fix for backslash escaping in transforms.milde2018-11-211-109/+8
| | | | | | | | | Still waiting for review. Reverts last three commits from a local "feature branch" unintentionally applied to trunk with `git svn`. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Use single backslashes for escaping.milde2018-11-201-8/+109
| | | | | | | | Let the smartquote transform take advantage of the representation of escaping backslashes in the doctree as null characters. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8234 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Fix bug #332.milde2017-10-251-6/+36
| | | | | | | | Use open quote after whitespace, ZWSP, and ZWNJ. Code cleanup. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8190 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "smartquotes-locales" setting.milde2017-05-081-0/+22
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 317 ] Extra space inserted with French smartquotes .milde2017-04-241-0/+66
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8061 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update smartquotes: milde2017-03-311-5/+7
| | | | | | | | | | | | | * use the rules of the `Imprimerie nationale` as french default (full NBSP inside guillemets). * do not invert “ and ’ in en-UK: expect British authors to use u0027 APOSTROPHE for primary quotes and " for secondary quotes in the source. Set ``--smart-quotes=alt`` (or use en-UK-x-altquot) for inversion by `smartquotes`. * do not call ``educate_backticks`` in the SmartQuotes transform: backticks have a special meaning in rST. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8053 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 313 ] differentiate apostrophe from single quote (if possible).milde2017-03-191-19/+31
| | | | | | Mind, that this is not possible for apostrophe at end of words. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8050 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update and add smartquote definitions for some languages.milde2017-01-171-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test update.milde2016-05-241-0/+11
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7940 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistently use "utf-8" (not "utf8") in magic comment giving source encoding.milde2013-06-041-1/+1
| | | | | | | Fixes problems with Docutils installed in "virtualenv" https://sourceforge.net/p/docutils/patches/105/ git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7668 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* smartquotes: Skip emtpy text tokens without updating the last character.milde2013-01-041-2/+14
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7585 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* SmartQuotes transform: language-depended quote characters.milde2012-11-261-6/+77
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7540 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Smartquotes: correct "educating" of quotes around inline markup.milde2012-11-181-2/+81
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7537 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add SmartQuotes transform for typographic quotes and dashes.milde2012-10-161-0/+51
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7530 929543f6-e4f2-0310-98a6-ba3bd3dd1d04