summaryrefslogtreecommitdiff
path: root/markdown/test_tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/test_tools.py')
-rw-r--r--markdown/test_tools.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/markdown/test_tools.py b/markdown/test_tools.py
index 2ce0e74..c4db6b2 100644
--- a/markdown/test_tools.py
+++ b/markdown/test_tools.py
@@ -35,7 +35,7 @@ __all__ = ['TestCase', 'LegacyTestCase', 'Kwargs']
class TestCase(unittest.TestCase):
"""
- A unittest.TestCase subclass with helpers for testing Markdown output.
+ A `unittest.TestCase` subclass with helpers for testing Markdown output.
Define `default_kwargs` as a dict of keywords to pass to Markdown for each
test. The defaults can be overridden on individual tests.
@@ -43,13 +43,13 @@ class TestCase(unittest.TestCase):
The `assertMarkdownRenders` method accepts the source text, the expected
output, and any keywords to pass to Markdown. The `default_kwargs` are used
except where overridden by `kwargs`. The output and expected output are passed
- to `TestCase.assertMultiLineEqual`. An AssertionError is raised with a diff
+ to `TestCase.assertMultiLineEqual`. An `AssertionError` is raised with a diff
if the actual output does not equal the expected output.
The `dedent` method is available to dedent triple-quoted strings if
necessary.
- In all other respects, behaves as unittest.TestCase.
+ In all other respects, behaves as `unittest.TestCase`.
"""
default_kwargs = {}
@@ -80,7 +80,7 @@ class TestCase(unittest.TestCase):
"""
# TODO: If/when actual output ends with a newline, then use:
- # return textwrap.dedent(text.strip('/n'))
+ # return textwrap.dedent(text.strip('/n'))
return textwrap.dedent(text).strip()
@@ -121,7 +121,7 @@ class Kwargs(dict):
def _normalize_whitespace(text):
- """ Normalize whitespace for a string of html using tidylib. """
+ """ Normalize whitespace for a string of html using `tidylib`. """
output, errors = tidylib.tidy_fragment(text, options={
'drop_empty_paras': 0,
'fix_backslash': 0,
@@ -195,15 +195,15 @@ class LegacyTestCase(unittest.TestCase, metaclass=LegacyTestMeta):
text-based test files and define various behaviors/defaults for those tests.
The following properties are supported:
- location: A path to the directory of test files. An absolute path is preferred.
- exclude: A list of tests to exclude. Each test name should comprise the filename
+ `location`: A path to the directory of test files. An absolute path is preferred.
+ `exclude`: A list of tests to exclude. Each test name should comprise the filename
without an extension.
- normalize: A boolean value indicating if the HTML should be normalized.
+ `normalize`: A boolean value indicating if the HTML should be normalized.
Default: `False`.
- input_ext: A string containing the file extension of input files. Default: `.txt`.
- ouput_ext: A string containing the file extension of expected output files.
+ `input_ext`: A string containing the file extension of input files. Default: `.txt`.
+ `output_ext`: A string containing the file extension of expected output files.
Default: `html`.
- default_kwargs: A `Kwargs` instance which stores the default set of keyword
+ `default_kwargs`: A `Kwargs` instance which stores the default set of keyword
arguments for all test files in the directory.
In addition, properties can be defined for each individual set of test files within
@@ -214,7 +214,7 @@ class LegacyTestCase(unittest.TestCase, metaclass=LegacyTestMeta):
test file. The keyword arguments will "update" the `default_kwargs`.
When the class instance is created, it will walk the given directory and create
- a separate unitttest for each set of test files using the naming scheme:
- `test_filename`. One unittest will be run for each set of input and output files.
+ a separate `Unitttest` for each set of test files using the naming scheme:
+ `test_filename`. One `Unittest` will be run for each set of input and output files.
"""
pass