summaryrefslogtreecommitdiff
path: root/docutils/test/test_settings.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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/+7
| | | | | | | | 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-11/+14
| | | | | | | | | | | 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
* Simplify ``ConfigFileTests.compare_output``aa-turner2022-10-211-17/+6
| | | | | | | Compare dicts directly rather than through string indirection. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9171 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Cleanup.milde2022-07-281-1/+0
| | | | | | | | Fix typo. Remove spurious whitespace. Bare "except" replaced with ``except Exception``. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9115 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare switch from optparse to argparse.milde2022-03-171-3/+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-2/+2
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid multiple statements on one line. Fix redundant backslashmilde2022-03-051-1/+2
| | | | | | | | | | | | Exceptions for sets of empty class definitions and other cases where it improves comprehension. flake8 rules E502: the backslash is redundant between brackets E701: multiple statements on one line (colon) E704: multiple statements on one line (def) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9032 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-9/+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
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+3
| | | | | | | | 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
* Fix (some) missing blank linesmilde2022-03-041-0/+1
| | | | | | | | flake8 rules E301: expected 1 blank line, found 0 E306: expected 1 blank line before a nested definition, found 0 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9024 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-2/+2
| | | | | | | | | 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 missing whitespace after ',' or ':'.milde2022-03-031-4/+4
| | | | | | | | flake8 rule E231. Mostly trailing commas in list and dictionary literals. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix whitespace before/after delimiters and colon.milde2022-03-031-21/+21
| | | | | | | | | | | | | | Flake rules E201 whitespace after '(' E202 whitespace before '}' E203 whitespace before ':' E211 whitespace before '(' Exception: : as binary operator in extended slices (cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix r9010.milde2022-02-251-4/+5
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9013 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test error reporting for config file syntax errors.milde2022-02-211-16/+22
| | | | | | | | Config file syntax errors should be reported with position (file and section) also for errors raised by validation with frontend.validate_*(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9010 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add test for configuration file specification. Fix false positives.milde2022-02-071-6/+25
| | | | | | | | | | | Test standard configuration files paths. Test handling of the DOCUTILSCONFIG environment variable. https://docutils.sourceforge.io/docs/user/config.html#configuration-files Avoid false positives when testing for Warnings (ignore additional warnings). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9000 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes, mostly documentation. Test more "list" settings.milde2022-02-051-6/+13
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8998 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-291-5/+8
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-261-65/+52
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing comma (fix syntax error).milde2022-01-241-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8964 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test config settings in "non-native" config file sections.milde2022-01-241-1/+20
| | | | | | | | | | | | | Config file sections may also contain settings from other components. They are used, if * they are defined in an active "SettingsSpec.settings_spec", * the containing section is the `confg_section` or in the `config_section_overrides` of one of the active components. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8963 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Test config settings with "side-effects" (overwriting other settings).milde2022-01-241-6/+23
| | | | | | | | | | | | | | Add samples testing the handling of configuration file settings that affect other settings: * `input_encoding`, `output_encoding`, and `error_encoding` also set the respective `*_encoding_error_handler` if the value has the form `<encoding>:<handler>`. * `stylesheet` and `stylesheet_path` are mutually exclusive and (re)set the other setting to None. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8962 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix/silence DeprecationWarnings and RessourceWarnings.milde2022-01-061-0/+2
| | | | | | | 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@8933 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-2/+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
* Deprecation warning updates.milde2021-11-051-6/+15
| | | | | | | | | | - Make `frontend.ConfigDeprecationWarning` a subclass of `FutureWarning` as it is also intended for end users. https://docs.python.org/3/library/warnings.html#warning-categories - Update deprecation warning tests. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8879 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-4/+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
* Add "smartquotes-locales" setting.milde2017-05-081-1/+60
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Bugfix: do not make "stylesheet-path"s absolute.milde2013-03-151-3/+3
| | | | | | | | The --stylesheet-path arguments are searched in the --stylesheet-dirs, therefore must not be made absolute before. Thanks to Martin Gignac for tracking down the bug. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7630 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify/simplify type testing in "validate_*_list".milde2013-01-011-4/+9
| | | | | | | Circumvent the problem that the value may be "unicode" or "str" by testing for "not a list". git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7584 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix: 3598893 --stylesheet and --stylesheet-path options broken, patch ↵grubert2012-12-311-1/+1
| | | | | | partially applied git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7583 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add tests for frontend.validate_comma_separated_list and ↵grubert2012-12-311-0/+25
| | | | | | frontend.validate_colon_separated_string_list git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7581 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use True/False for booleans. frontend.validate_ternary() returns True/False ↵milde2012-11-261-9/+9
| | | | | | or value. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7539 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New setting validators, code cleanup.milde2012-10-121-4/+5
| | | | | | (validate_comma_separated_string_list, validate_ternary) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7526 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop support for Python 2.3.milde2012-06-221-5/+0
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7463 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* python 2.3 alias unittest.TestCase.assertTrue (possibly reverted on next ↵grubert2012-05-011-0/+6
| | | | | | release) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7400 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [ 3481980 ] Use os.getcwdu() in make_paths_absolute().milde2012-02-031-0/+24
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7339 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
* Fix parsing of lists from config files.milde2011-11-221-2/+10
| | | | | | | | The "strip-classes" and "strip-elements-with-classes" settings expect a list but did not convert values given in a config file - making it impossible to use them in a config file. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7224 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* One more cleanup as we require Python 2.3 now.milde2009-10-091-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@6159 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare for python 3.0: minimize "types" module where possible (gbrandl).grubert2008-11-301-1/+0
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5738 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Merged abolish-userstring-haskey r5609:5616 to trunk.strank2008-07-281-2/+2
| | | | | | 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-2/+2
| | | | 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-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@5607 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* correct faulty setting definitions & add test; 0.4 backport candidategoodger2006-11-121-0/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4802 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