{ "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",
" \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",
"