CodeToMarkdown_test.py - Unit testing¶
This test bench exercises the CodeToRest module. First, set up for
development (see To package). To run, execute py.test
from the
command line. Note the period in this command – pytest
does NOT work
(it is a completely different program).
Imports¶
These are listed in the order prescribed by PEP 8.
Library imports¶
None.
Third-party imports¶
None.
Local application imports¶
Define the Markdown put at the beginning of any the outputs of code_to_markdown_string
.
Transform source code into its equivalent Markdown.
_generate_rest
inserts a <div>
to format indented comments followed by
a set-line
directive to show line numbers of the comments correctly. This
function generates the same string.
The size of the indent, in characters.
Each space = 0.5 em, so a 3-space indent would be size=1.5
.
The standard string which marks the end of a <div>
.
Provide a simple way to run a test.
Test pure code.
Test only a comment.
Test an indented comment.
Test an indented comment with code.
Test a syntax error in Python code.