Documentation of doctestprinter¶
doctestprinter contains convenience functions to print outputs more adequate for doctests.
Example features:
removes trailing whitespaces: pandas.DataFrame generates trailing whitespaces, which interferes with auto text ‘trailing whitespace’ removal features, leading to failed tests.
maximum line width: break long sequences at whitespaces to a paragraph.
Installation¶
Either install the current release from pip …
pip install doctestprinter
… or the latest development state of the gitlab repository.
$ pip install git+https://gitlab.com/david.scheliga/doctestprinter.git@dev --upgrade
|
The general printing method for doctests. |
Prints the first level of the iterable or mapping. |
|
|
EditingItem is a wrapper class for the edit_item argument of |
|
Prepares anything for printing. |
Builds explicitly string representations for pandas.DataFrame and pandas.Series objects. |
|
Prints explicitly pandas.DataFrame and pandas.Series objects. |
|
|
Rounds items within collections (dict, list, tuple). |
|
Represents the path on a Windows machine as a Posix-Path representation turning back slashes to forward slashes. |
Set the string represenation of anything in quotes. |
|
Strips the given base path from the path to show and performing |
|
Strips trailing tabs from the text. |
|
Strips trailing whitespaces from the text. |
|
Strips both trailing whitespaces and tabs from the text. |