summaryrefslogtreecommitdiff
path: root/markdown/test_tools.py
Commit message (Collapse)AuthorAgeFilesLines
* Use pyspelling to check spelling.Waylan Limberg2023-04-061-13/+13
| | | In addition to checking the spelling in our documentation, we are now also checking the spelling of the README.md and similar files as well as comments in our Python code.
* Fix typos and remove trailing spacesKian-Meng Ang2022-04-101-1/+1
|
* [style]: fix various typos in docstrings and commentsFlorian Best2022-03-181-1/+1
|
* Ensure permalinks and ankorlinks are not restricted by toc_depthWaylan Limberg2021-02-241-3/+13
| | | | | | | | | | | | This fixes a regression which was introduced with support for toc_depth. Relevant tests have been moved and updated to the new framework. Fixes #1107. The test framework also received an addition. The assertMarkdownRenders method now accepts a new keyword expected_attrs which consists of a dict of attrs and expected values. Each is checked against the attr of the Markdown instance. This was needed to check the value of md.toc and md.toc_tokens in some of the included tests.
* Some test tweaks.Waylan Limberg2020-10-081-2/+5
| | | | | | | | | | * Pygments specific tests now only run when the pygments version installed matches the expected version. That version is defined in an environment variable (PYGMENTS_VERSION) in the 'pygments' tox env (see #1030). * When the Python lib tidylib is installed but the underlying c lib is not, the relevant tests are now skipped rather than fail. This matches the behavior when the Python lib is not installed. The tox envs are now useful on systems which don't have the c lib installed.
* Limit depth of blockquotes using Python's recursion limit. (#991)Waylan Limberg2020-06-291-1/+28
| | | | | | | | | | | | | | | | | If the Python stack comes within 100 frames of the recursion limit, then the nesting limit of blockquotes is met. Any remaining text, including angle brackets, are simply wrapped in a paragraph. To increasing the nesting depth, increase Python's recursion limit. However, be aware that each level of recursion will likely result in multiple frames being added to the Python stack. Therefore, the recursion depth and nesting depth are not one-to-one. Performance is an concern here. However, the current solution seems like a reasonable compromise. It doesn't slow things down too much, but also avoids Markdown input resulting in an error. This is mostly only a concern with contrived input anyway. For the average Markdown document, this will likely never be an issue. Fixes #799.
* Fix simple typo: wihtout -> withoutTim Gates2020-02-211-1/+1
| | | | Closes #913
* Drop support for Python 2.7 (#865)Hugo van Kemenade2019-10-241-12/+3
| | | | | | | * Python syntax upgraded using `pyupgrade --py3-plus` * Travis no longer uses `sudo`. See https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration See #760 for Python Version Support Timeline and related dicussion.
* Consistent copyright headers.Waylan Limberg2018-07-271-0/+22
| | | | Fixes #435.
* Correct spelling mistakes.Edward Betts2018-01-131-3/+3
|
* Switch from nose to unittestWaylan Limberg2018-01-081-1/+124
| | | | | | | | | | | | | | | All file-based tests are now defined as unittest test cases via a metaclass which walks a directory and builds a unittest for each pair of test files. To run the tests just run `python -m unittest discover tests`. Or use tox as the tox config has been updated to run the new tests and all nose specific code has been removed. The test generator tools have been removed as well. If any changes or additions need to be made to tests, they should be implemented using the new framework rather than with the file-based tests. Eventually, only the PHP and pl tests should remain as file-based tests.
* Provide new testing framework.Waylan Limberg2018-01-081-0/+44
As a part of the Markdown lib, test tools can be used by third party extensions. Also keeps test dir clean as it only contains actual tests. More work in this vein to come as the need for Nose is removed. Tests are defined as Unittests rather than in text files allowing features to be more easily broken into units and run individually. Based completely on standard lib unittest with no external dependencies. Use `python -m unittest tests.test_syntax` to run. Pulled some tests from https://github.com/karlcow/markdown-testsuite. Many more test units to pull from that source. As we encounter the need to edit an existing textfile-based test, or add a new test, a new test should be created with this framework and the old test should be deleted. Also need to delete existing testfile-based tests which are covered in the new tests included here.