Helper methods to print readable results for doctest strings.
Project description
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
Installing the latest release using pip is recommended.
$ pip install doctestprinter
The latest development state can be obtained from gitlab using pip.
$ pip install git+https://gitlab.com/david.scheliga/doctestprinter.git@dev
Basic Usage
The default method is doctestprinter.doctest_print
.
>>> from doctestprinter import doctest_print
>>> sample_object = list(range(80))
>>> doctest_print(sample_object, max_line_width=70)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, 77, 78, 79]
Read-the-docs for further functionality.
Contribution
Any contribution by reporting a bug or desired changes are welcomed. The preferred way is to create an issue on the gitlab's project page, to keep track of everything regarding this project.
Contribution of Source Code
Code style
This project follows the recommendations of PEP8. The project is using black as the code formatter.
Workflow
- Fork the project on Gitlab.
- Commit changes to your own branch.
- Submit a pull request from your fork's branch to our branch 'dev'.
Authors
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details
Acknowledge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for doctestprinter-0.5b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9dd04fcb89d240a2340c3075969dbad2976e15c406f74d2eb6d3efd933824ab |
|
MD5 | 7a0b835bdc5da27c9a42e5dd4ba6a8b6 |
|
BLAKE2b-256 | bb16b4f9a934e835d23b03a92df215bc470a9bcf4b037de7665c39603def8434 |