{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Testing Python Programs\n", "\n", "[back to main page](../index.ipynb)\n", "\n", "Due to the dynamic character of the Python language, many potential programming\n", "errors are only detected at runtime.\n", "To find some of them at an earlier stage, you should use *unit tests*,\n", "*syntax checkers* and probably more ...\n", "\n", "https://wiki.python.org/moin/PythonTestingToolsTaxonomy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Built-In Unit Testing\n", "\n", "[unittest](https://docs.python.org/3.4/library/unittest.html) (standard library)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Testing Frameworks\n", "\n", "[nose](https://nose.readthedocs.org/en/latest/)\n", "\n", "[py.test](http://pytest.org/latest/)\n", "\n", "[tox](http://testrun.org/tox/latest/)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Code Coverage\n", "\n", "https://pypi.python.org/pypi/coverage\n", "\n", "But don't try to blindly increase coverage, read this first:\n", "[How to Misuse Code Coverage](http://www.exampler.com/testing-com/writings/coverage.pdf)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Static Code Analysis\n", "\n", "[Syntax Checkers](syntax-checkers.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## External Links\n", "\n", "https://github.com/rasbt/python_reference/blob/master/tutorials/unit_testing.md\n", "\n", "https://blog.daftcode.pl/the-cleaning-hand-of-pytest-28f434f4b684" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

\n", " \n", " \"CC0\"\n", " \n", "
\n", " To the extent possible under law,\n", " the person who associated CC0\n", " with this work has waived all copyright and related or neighboring\n", " rights to this work.\n", "

" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.3" } }, "nbformat": 4, "nbformat_minor": 1 }