summaryrefslogtreecommitdiff
path: root/docutils/test/test_error_reporting.py
Commit message (Collapse)AuthorAgeFilesLines
* 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/+5
| | | | | | | | 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
* Make the tests agnostic to the working directoryaa-turner2022-11-101-2/+1
| | | | | | | | | | | 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
* Inline ``DocutilsTestSupport.testroot``aa-turner2022-11-091-17/+4
| | | | | | | | | - 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
* Change working directory once for all testsaa-turner2022-10-211-0/+6
| | | | | | | | | The working directory is set to ``testroot`` in the initialisation of ``DocutilsTestSupport``, meaning we do not need to set it to the same directory in each test. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9144 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify naming of the "utf-8" codec.milde2022-06-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare switch from optparse to argparse.milde2022-03-171-5/+3
| | | | | | | | | | | | | 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@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@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-3/+9
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix imports.milde2022-03-051-2/+3
| | | | | | | | flake8 rules E401: multiple imports on one line E402: module level import not at top of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9027 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@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-041-1/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use short contact mail addressmilde2022-01-201-1/+1
| | | | | | for Günter Milde at all places. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8957 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop use of utils.error_reporting module and deprecate it.milde2022-01-071-3/+5
| | | | | | | | | | SafeString not required in Python 3 ErrorString obsoleted by new function io.error_string(). ErrorOutput and locale_encoding moved to docutils.io. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8937 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop special-casing for Python 2.x in tests and tools.milde2022-01-031-83/+21
| | | | | | | 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@8927 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-1/+0
| | | | | | 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
* Work around #434milde2021-11-151-6/+7
| | | | | | | Avoid "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 0: invalid start byte" by use of a valid UTF8 test b-string. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8887 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-271-3/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistent Python 3 checks.milde2019-08-261-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Add aliases for removed symbolsmilde2019-08-261-0/+3
| | | | | | | | | | 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: http://svn.code.sf.net/p/docutils/code/trunk@8348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to 'except foo as bar' syntaxmilde2019-08-261-7/+7
| | | | | | | | This is the only form supported in Python 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8347 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-4/+6
| | | | | | | | | | 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
* Drop support for Python 3.3milde2019-08-261-9/+4
| | | | | | | | | | This doesn't involve a whole lot of changes, but references to Python 3.3 (plus some to the already removed Python 2.6) are removed and 'setup.py' is updated as necessary. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8338 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Cleanup: remove <2.6 compatibility code.milde2017-11-081-5/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8201 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop 2.4 and 2.5 compatibility code, part 2.milde2017-08-141-15/+14
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8164 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop compatibility code for Python 2.4 and 2.5.milde2017-08-111-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8163 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 223 ] by removing redundant tests we do not have control over.milde2013-09-281-14/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7723 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
* math, error_reporting, and urischemes moved to the utils package. milde2012-06-251-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7464 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fixup: more save implementation of binary data output under Python 3.milde2012-06-131-2/+2
| | | | | | Prevent test error under Python 3. Add tests for FileOutput. Document. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7440 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Replace deprecated aliases for assert methods with correct names.milde2012-02-031-9/+9
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7337 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply [ 3365041 ] to fix py3k unittest regressions.milde2011-07-201-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7097 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New sub-module and test suite for error reporting.milde2011-05-191-0/+339
* Code to handle encoding/decoding errors when reporting exceptions. * Test and fix error reporting with problematic locale settings. (https://bugs.gentoo.org/show_bug.cgi?id=349101) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04