summaryrefslogtreecommitdiff
path: root/docutils/test/test_functional.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-0/+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
* Put `first` and `second` arguments of `assertEqual` on the top line.milde2022-11-241-6/+4
| | | | | | | | | 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
* Drop default settings from individual functional test files.milde2022-11-161-3/+18
| | | | | | | | | 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
* Remove ``_test_more`` supportaa-turner2022-10-271-11/+3
| | | | | | | 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
* Use subtests for the functional testsaa-turner2022-10-271-145/+78
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9181 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Inline ``_default`` in functional testsaa-turner2022-10-271-9/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9180 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change working directory once for all testsaa-turner2022-10-211-2/+0
| | | | | | | | | 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
* Documentation updatemilde2022-06-171-1/+1
| | | | | | | | | | | | Remove dead link and outdated footnote about limitations in Python2. Add link to acceptable values of encoding error handlers. Harmonise help output. Use UTF-8 in prose text, error messages, and documentation. Use 'utf-8' in code or when referring to code. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9077 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add encoding arguments when opening files.milde2022-06-151-2/+3
| | | | | | | | | | | | | Specify intended incoding, when possible. Avoids `EncodingWarning` in PEP 597 and nasty surprises if the default encoding is not what the user expects. Keep encoding unspecified where this may be an API change. Based on patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9072 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused local variablesmilde2022-03-051-2/+0
| | | | | | | | flake rule F841: local variable 'foo' is assigned to but never used In test_odt.py, a no-op class definition is removed completely. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9038 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
* Various small fixes.milde2022-01-291-1/+3
| | | | | | | | | | | | Update comments One more generator expression instead of lists. Fix unbound variable. Drop duplicate import. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8990 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Document incompatibility with "pytest" and "nosetest". Update.milde2022-01-121-5/+13
| | | | | | | | | 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@8945 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop special-casing for Python 2.x in tests and tools.milde2022-01-031-18/+2
| | | | | | | 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 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
* remove the helper function "walker" for os.path.walk from python2.2grubert2020-08-101-15/+0
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8534 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* remove try-except catching python2.2 missing os.walkgrubert2020-08-101-13/+10
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8533 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: http://svn.code.sf.net/p/docutils/code/trunk@8372 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-271-4/+4
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-2/+3
| | | | | | | | | | 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
* loggrubert2019-08-201-3/+5
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8325 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use True/False for booleans. frontend.validate_ternary() returns True/False ↵milde2012-11-261-1/+1
| | | | | | or value. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7539 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Replace deprecated aliases for assert methods with correct names.milde2012-02-031-2/+2
| | | | 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-1/+0
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7097 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply part of patch 3303733 to allow testing with Python 3 and LANG=C.milde2011-05-241-1/+5
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7039 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix: failsafe encoding of unicode strings before writing to sys.stderrmilde2011-05-061-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7027 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fix errors with Python 3milde2010-09-211-6/+7
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6430 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fixed issue with line endings causing test suite failures with snapshot ↵goodger2010-07-211-1/+4
| | | | | | downloads (fixes SF bug 3015675) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6380 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* fix indentation whitespacemilde2010-04-231-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6311 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure test work as intended in all supported Python versions.milde2010-03-181-8/+19
| | | | | | | | Take care to prevent false positives caused by varying error messages or default behaviour. Extend test support to p3k. Fixes [2972615]. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6268 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* test_functional.py failed printing diff containing non-ASCII charsmilde2009-04-271-1/+1
| | | | | | | Failsave version is to explicitely encode with replace error handler, encoding as unicode would be a (maybe better) alternative. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Convert docutils to Python 3 (at least so that it runs the test suite.)gbrandl2009-04-011-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5889 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* moved explanation/instructions into templates (no expected output, & output ↵goodger2008-12-091-20/+26
| | | | | | differs from expected) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5813 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* test_functional.py: Less verbose but still helpful output.milde2008-12-091-7/+8
| | | | | | | Do not show full output (but point to output file) if there is no expected output. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5811 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* test_functional.py: give some hints if there is no expected output (yet)milde2008-12-081-3/+12
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5809 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare for python 3.0: use os.walk instead os.path.walk.grubert2008-11-301-1/+13
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5739 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Merged abolish-userstring-haskey r5609:5616 to trunk.strank2008-07-281-5/+6
| | | | | | Backwards compatible changes for easier transition to py3.0. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5618 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* undo accidental commit to trunkstrank2008-07-231-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5608 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Replace all has_key with the in operator.strank2008-07-231-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5607 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* adjusted name and email addresswiemann2007-05-311-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5174 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* use $Id$ instead of $Date$ and $Revision$;wiemann2006-05-211-4/+2
| | | | | | | | collapsed Author and Contact fields; use canonical email addresses for David and Felix; (I have reviewed the diff) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4564 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* moved clear_roles to DocutilsTestSupport.CustomTestCase so that it is used ↵wiemann2006-01-091-9/+0
| | | | | | globally git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4254 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* added workaround for left-over default roles in functional testswiemann2006-01-091-0/+9
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4253 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* merged branches/s5 changes r4011:4155 into trunk/docutilsgoodger2005-12-081-15/+35
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4156 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* corrected order of importsgoodger2005-12-031-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4132 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* use universal newlines when opening expected output files to guard against ↵goodger2005-04-061-1/+3
| | | | | | cross-platform line ending problems git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3176 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* updated for SVNgoodger2005-03-221-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3076 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* improved usefulness of test outputgoodger2004-10-051-2/+9
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@2693 929543f6-e4f2-0310-98a6-ba3bd3dd1d04