| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
We need a review of the "string output" interface and a consensus
on the "clean" end-state before starting with the implementation.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9369 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
Do not fail for pre-release versions
(c.f. https://pygments.org/docs/changelog/).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9355 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
Pygments 2.14 contains changes in the Python lexer which break
``test_code``, ``test_code_long``, and ``test_include``.
https://pygments.org/docs/changelog/#version-2-14-0
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9354 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9341 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
| |
Don't mention the "nose" test framework.
(It is unmaintained, deprecated, and fails to find all test cases.)
Hint to a possible future dependency on "pytest".
Two recently added test scripts missed the executable bit.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9308 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
As we provide a mock Sphinx package, there is no need to emphasise
recommonmark's dependency on Sphinx.
Wrap error message. Adapt the test case.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9302 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
| |
After basing "alltests.py" on the `unittest.defaultTestLoader`, we can (again)
skip the complete directory from the __init__.py file.
Simplify recommonmark test files (when running individually,
failing with an ImportError when recommonmark is missing is no problem).
Keep the `sys.path` setup, we still want test the local "docutils" package.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9301 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
A name mismatch occured during the test refactoring which
prevented deleting a test sample requiring "pygments".
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9266 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean the global caches to ensure predictable test results.
(There were additional warnings for undefined directive and
role names under Windows. These were suppressed due to other
tests adding canonical names to the cache under Linux.)
Add additional warnings to the expected output samples.
Registering directives at test module level no longer works.
Move `register_directive()` call to the test function.
Signed-off-by: milde <milde@users.sf.net>
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9265 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
Skipping the complete test directory does not work with "alltests.py".
Also fix running the individual tests scripts.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9264 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After test refactoring, test scripts failed with ImportError
unless started from the "test root" ``docutils/test/``.
Prepend the "docutils root" to the Python library path
so we import the local `docutils` and `test` packages,
ignoring an eventually installed Docutils package.
Set executable bit where this was missing.
Also:
Use "pathlib" instead of "os.path" for self-documenting path manipulations.
Remove duplicate ``import unittest`` statements.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9263 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Tests in ``test_include`` previously only passed when the current
working directory was equal to the test root. This change makes it
possible to run the tests without changing the CWD, as part of the
test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9233 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
- Move all usages of ``exception_data`` to using the ``try`` /
``except`` pattern as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9232 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
- Move all usages of ``ParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9230 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
| |
- Move all usages of ``GridTableParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9224 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
- Move all usages of ``SimpleTableParserTestSuite.generateTests``
to using subtests, as part of the test suite refactoring project
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9223 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
| |
- Move all usages of ``RecommonmarkParserTestSuite.generateTests``
to using subtests.
- Move the conditional test skipping logic to ``__init__.py`` in
``test_recommonmark``, and move the missing module test from
``test_recommonmark.test_misc`` to ``test_get_parser_class``, as
otherwise the test would never run.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9222 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
| |
Use a simpler sample file for signed UTF-16 input.
Test encoding auto-detection
to ensure it is in sync with encoding handling for the main document.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9220 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
``docutils.core.publish_string`` uses Python 2 notion of a
bytestring, such that in the general case it returns Python 3's
``bytes`` type. Revision 9167 attempted to address this distinction
by introducing ``publish_bytes`` and changing ``publish_string`` to
always return unicode text data as Python's ``str`` type. This is a
backwards compatibility break, so in this commit we restore the
previous behaviour, whilst simultaneously deprecating support for
returning binary data from the ``docutils.core.publish_string``
function for at least two releases of Docutils.
As part of this, we also deprecate returning binary data from the
``docutils.io.StringOutput.encode`` method, docutils.io.BytesOutput``
should be used in its stead.
Finally, we update tests for the reversion to the previous behaviour.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9202 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
Ensure all names are lowercase, and replace all non-alpha characters
with underscores.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9193 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9169 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
Ensure that the ``core.publish_string`` always returns a string,
introduce ``core.publish_bytes`` for binary output.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9167 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9164 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9148 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
unittest migration.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9141 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
E275: missing whitespace after keyword
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9127 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9122 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
The attribute was moved to "io" after the last release.
Backwards compatibility is ensured via `locale_encoding`
in the (deprecated) "utils.error_reporting" module.
Fix HISTORY entries.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9078 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
| |
Use `locale.getpreferredencoding(False)` since we dropped support
for older Python versions with side-effects.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9074 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
| |
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser names 'commonmark' and 'markdown' now
select the first locally installed parser
from a list of compatible 3rd-party parser packages
(pycmark, myst, and recommonmark).
The parsers return slightly different doctrees.
This should not matter for HTML output but leads to false
negatives with the "include" directive test. Therefore the test
case now specifies "recommonmark".
The "pycmark" parser defines transformations to comlete nested parsing
and clean up non-standard nodes. These transformations must also
be run when including a document fragment.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9048 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The canonical PEP base URL changed to "peps.python.org/".
The PEP-writer template.txt added a "source" link that no longer
works due to sources now only be stored on github and having
two possible file extensions ("txt" or "rst").
Adapt the header to resemble the header of official PEP documents
(which are now produced using Sphinx).
Fixes [bug:#445].
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9045 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
flake8 rule F401
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
| |
flake 8 rule W605
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9036 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
|
|
| |
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@9033 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Use unicode.assertWarnsRegex() instead of "hand written"
warnings catching.
Use unicode.assertRaises() as context manager
(unless this would mean an additional code line).
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9011 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|