Lines Matching full:markdown
5 Python-Markdown provides some testing tools which simplify testing actual
6 Markdown output against expected output. The tools are built on the Python
8 required. While Python-Markdown uses the tools for its own tests, they were
10 Therefore, the tools are importable from `markdown.test_tools`.
13 `markdown.test_tools.TestCase` and `markdown.test_tools.LegacyTestCase`.
15 ## markdown.test_tools.TestCase
17 The `markdown.test_tools.TestCase` class is a `unittest.TestCase` subclass with
18 a few additional helpers to make testing Markdown output easier.
21 : `default_kwargs`: A `dict` of keywords to pass to Markdown for each
26 dictionary of `expected_attrs`, and any keywords to pass to Markdown. The
33 name on the instance of the `Markdown` class using `TestCase.assertEqual`. An
38 In all other respects, `markdown.test_tools.TestCase` behaves as
42 An example Markdown test might look like this:
45 from markdown.test_tools import TestCase
50 # The Markdown source text used as input
64 # Other keyword arguments to pass to `markdown.markdown`
69 ## markdown.test_tools.LegacyTestCase
71 In the past Python-Markdown exclusively used file-based tests. Many of those
72 tests still exist in Python-Markdown's test suite, including the test files from
73 the [reference implementation][perl] (`markdown.pl`) and [PHP Markdown][PHP].
75 contains a snippet of Markdown source text formatted for a specific syntax
77 When the test suite is run, each text file is run through Markdown and the
82 A separate `markdown.test_tools.LegacyTestCase` subclass must be created for
99 * `default_kwargs`: A `markdown.test_tools.Kwargs` instance which stores the
106 `markdown.test_tools.Kwargs` instance which contains the keyword arguments that
107 should be passed to `markdown.markdown` for that test file. The keyword
118 from markdown.test_tools import LegacyTestCase, Kwargs
139 extensions=['markdown.extensions.toc'],
140 extension_configs={'markdown.extensions.toc': {'permalink': "[link]"}}
151 ## Running Python-Markdown's Tests
153 As all of the tests for the `markdown` library are unit tests, standard
155 Python-Markdown's tests, from the root of the git repository, run the following
164 `unittest.TestCase`, `markdown.test_tools.TestCase`, and
165 `markdown.test_tools.LegacyTestCase` subclasses. Normal [unittest] discovery
174 [Perl]: https://daringfireball.net/projects/markdown/
175 [PHP]: http://michelf.com/projects/php-markdown/