summaryrefslogtreecommitdiff
path: root/test/DocutilsTestSupport.py
Commit message (Collapse)AuthorAgeFilesLines
* Prepare switch from optparse to argparse.milde2022-03-171-8/+4
| | | | | | | | | | | | | New interface function: frontend.get_default_settings() easy access to default settings for programmatic use. Add deprecation warnings. Catch them when accessing the deprecated functions from Docutils. Make docstrings conform to the Documentation Policies (first line: summary, next line empty). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9047 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-4/+4
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid line break after binary operator.milde2022-03-051-3/+3
| | | | | | | | | Breaking before binary operators is the recommended style in PEP 8 (changed in April 2016). flake8 rule W504 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9035 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use bare 'except'.milde2022-03-051-1/+1
| | | | | | | | | | flake8 rule E722 Exception: as catchall, if * the right thing to do does not depend on the error * any error is reported or risen again. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9033 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-4/+4
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+2
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-3/+3
| | | | | | | | | 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/docutils@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-031-4/+4
| | | | | | | | | | | | | | flake8 rules E225: missing whitespace around operator E226: missing whitespace around arithmetic operator E228: missing whitespace around modulo operator Keep ignoring the latter two rules: PEP8 limits the recommendation to "operators with lowest priority" "if operators with different priorities are used". flake8 also flags top level operators. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-261-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate definitions in language modules. Import locale_encoding from `docutils.io` Use decorator for staticmethod Use True/False over 1/0. `collections.OrderedDict` no longer required, all dictionaries are ordered from Python 3.7 Remove obsolete `__cmp__` method cf. https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons Use str instead of type(''). Zero-argument ``super()`` Simplify test support module as "u" prefix isn't used by repr in Python 3. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sourceforge.net -> https://docutils.sourceforge.iomilde2022-01-201-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8956 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip "recommonmark" tests instead of silently ignoring.milde2022-01-121-23/+23
| | | | | | Skip "recommonmark" parser tests if parser not found or too old. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8946 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Document incompatibility with "pytest" and "nosetest". Update.milde2022-01-121-16/+20
| | | | | | | | | Triggered by [feature-request:#81]. Use PEP 3102 syntax instead of reading/deleting "**kwargs" items for "required keyword arguments". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8945 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update recommonmark wrapper and tests.milde2022-01-111-21/+24
| | | | | | Adapt to and test with "recommonmark" versions 0.6.0 and 0.7.1. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8943 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix/silence DeprecationWarnings and RessourceWarnings.milde2022-01-061-2/+0
| | | | | | | Found by Tomasz Kłoczko running "pytest" (cf. feature-request #81) and by running `python3 -W all alltests.py`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8933 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop special-casing for Python 2.x in tests and tools.milde2022-01-031-19/+8
| | | | | | | Use "python3" in the shebang line (cf. PEP 394 -- The "python" Command on Unix-Like Systems). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8927 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove 2.7-compatibility __future__ imports.milde2022-01-031-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More detailled system-message for include directive with missing parser.milde2021-12-231-5/+9
| | | | | | | | | The system-message issued when an "include" directive sets the "parser" option to "markdown", "commonmark" or "recommonmark" but the upstream parser module is not available has source/line info now. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8916 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Special-casing for Python 3.11: Null char valid in CSV.milde2021-11-271-0/+1
| | | | | | First part of a fix for bug #436. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8909 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor cleanup in DocutilsTestSupport.milde2021-11-051-3/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8877 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* recommonmark tests currently fail with newer versions.milde2021-04-091-0/+4
| | | | | | | Skip for now if recommonmark.__version__ != 0.4.0 to allow a fast bugfix release. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8683 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Clean up Markdown support.milde2021-01-031-4/+0
| | | | | | | | | | Set 'docutils-cli.py' shebang to python3 (better chance of markdown support). Remove the 'md2*.py' wrappers. (Use 'docutils-cli.py --parser=markdown'.) Remove hard-coded print output from test suite when there is no recommonmark module. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8601 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add support for Markdown.milde2020-12-011-3/+35
| | | | | | | | | | | | | | Provide a wrapper for the 3rd party `recommonmark`__ Markdown parser already in use in Sphinx. Add test cases for CommonMark parsing. Also: Correct copyright note and set executable bit on two tests. Fix small typo in test content. __ https://pypi.org/project/recommonmark/ git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8585 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove Test support classes for the orphaned Python Module Parser.milde2020-09-301-62/+0
| | | | | | | The Python module parser is orphaned and was moved to the sanbox on 07.12.2010. So these classes are no longer required. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8566 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Run python3 test like python2 run against source not the build/-directory.grubert2020-07-271-8/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8531 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify code.milde2019-08-271-7/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8373 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Wrap 'foo.keys()', 'zip(foo, bar') in 'list'milde2019-08-271-1/+1
| | | | | | | | | | | In Python 3, 'dict.keys()', 'zip' and 'map' no longer return a list but rather types 'dict_keys', 'zip' and 'map', respectively. You can't append to these types nor can you delete from them while in a loop. The simple solution to both issues is to wrap things in 'list'. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8372 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-271-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistent Python 3 checks.milde2019-08-261-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'sorted(foo)' instead of 'foo.sort()'milde2019-08-261-2/+1
| | | | | | | | This works with iterators also (like 'dict.keys()' in Python 3) Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8357 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace deprecated form of raising exceptionmilde2019-08-261-17/+4
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8353 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Add aliases for removed symbolsmilde2019-08-261-0/+4
| | | | | | | | | | Add aliases for symbols that have been removed in Python 3.x, namely basestring, unicode, unichr and StandardError. Signed-off-by: Stephen Finucane <stephen@that.guru> small fixes by Günter Milde. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to 'except foo as bar' syntaxmilde2019-08-261-4/+4
| | | | | | | | This is the only form supported in Python 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8347 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-13/+14
| | | | | | | | | | 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: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use new style classesmilde2019-08-261-1/+1
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8345 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use compatibility definitions for assertIn and assertNotIn only if required.milde2019-02-121-11/+12
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8245 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Html5 writer: Correctly sort docinfo and subtitle into "parts" dict.milde2018-06-051-22/+23
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8217 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop compatibility code for Python 2.4 and 2.5.milde2017-08-111-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8163 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use True/False for booleans. frontend.validate_ternary() returns True/False ↵milde2012-11-261-2/+2
| | | | | | or value. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7539 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Code cleanup and test html math output options.milde2012-10-251-4/+16
| | | | | | | | Based on patch by Dmitry Shachnev. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7534 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math, error_reporting, and urischemes moved to the utils package. milde2012-06-251-2/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7464 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop support for Python 2.3.milde2012-06-221-4/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7463 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fixup: more save implementation of binary data output under Python 3.milde2012-06-131-1/+1
| | | | | | Prevent test error under Python 3. Add tests for FileOutput. Document. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7440 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 3527842 ]. milde2012-06-041-6/+12
| | | | | | | | | | | | | | | | Under Python 3, converted tests and tools are now stored in the ``test3/`` and ``tools3/`` sub-directories and not installed in the PYTHONPATH. In order to make this work: - Make tests independent from the location of the ``test/`` directory. - Use converted sources from the ``build/`` directory for tests under Python 3. Remove functional/tests/stylesheet_path_html4css1.py made redunant by functional/tests/math_output_html.py. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7437 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* python 2.3 alias unittest.TestCase.assertTrue (possibly reverted on next ↵grubert2012-05-011-0/+4
| | | | | | release) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7400 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Replace deprecated aliases for assert methods with correct names.milde2012-02-031-7/+7
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7337 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Cleanup: Use True/False for boolean valuesmilde2012-01-191-18/+18
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7320 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fixed issue with line endings causing test suite failures with snapshot ↵goodger2010-07-211-0/+5
| | | | | | downloads (fixes SF bug 3015675) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@6380 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fix testing under py3kmilde2010-05-071-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@6320 929543f6-e4f2-0310-98a6-ba3bd3dd1d04