https://en.wikipedia.org/wiki/Software_testing
https://en.wikipedia.org/wiki/Python_(programming_language)
https://en.wikipedia.org/wiki/Software_testing
- https://en.wikipedia.org/wiki/Test-driven_development
- https://en.wikipedia.org/wiki/Assertion_(computing)
- http://docs.python-guide.org/en/latest/writing/tests/
- http://martinfowler.com/bliki/TestCoverage.html
- http://martinfowler.com/eaaCatalog/
- https://en.wikipedia.org/wiki/Code_coverage#Basic_coverage_criteria
- https://en.wikipedia.org/wiki/Category:Formal_methods
- http://stackoverflow.com/questions/4904096/whats-the-difference-between-unit-functional-acceptance-and-integration-test
- http://stackoverflow.com/questions/520064/what-is-unit-test-integration-test-smoke-test-regression-test
1. edit, edit, commit
2. edit, commit
3. todo, edit, commit
4. todo, edit, test, commit
5. todo, test, edit, test, commit
6. todo, test, edit, test, commit, tag
7. todo, branch, test, edit, test, commit, { tag, push, send patch }
8. todo, qnew, test, edit, test, commit, finish, { tag, push, send patch }
Homepage: https://www.python.org/
Source: https://hg.python.org/cpython
Docs: https://docs.python.org/2/
Docs: https://docs.python.org/devguide/
Docs: https://docs.python.org/devguide/documenting.html
Docs: https://wiki.python.org/moin/PythonBooks
Docs: http://www.onlineprogrammingbooks.com/python/
Docs: https://www.reddit.com/r/learnpython/wiki/index
Docs: https://www.reddit.com/r/learnpython/wiki/books
Docs: https://www.quora.com/Python-programming-language-1/What-are-the-best-books-courses-for-learning-Python
Docs: https://en.wikiversity.org/wiki/Python
Docs: https://www.class-central.com/search?q=python
Docs: http://learnxinyminutes.com/docs/python/
Tools: https://westurner.github.io/tools/#python
- http://docs.python.org/2/library/unittest.html
- http://docs.python.org/2/library/doctest.html
- http://wiki.python.org/moin/PythonTestingToolsTaxonomy
- http://docs.python-guide.org/en/latest/writing/tests/
- https://pypi.python.org/pypi/unittest2 (python < 2.7)
- https://pypi.python.org/pypi/mock (python < 3.3)
- https://pypi.python.org/pypi/pathlib (python < 3.4)
- testtools
Docs: https://docs.python.org/3/howto/pyporting.html
Docs: https://docs.python.org/3/howto/cporting.html
Docs: http://learnxinyminutes.com/docs/python3/
Tools: https://westurner.github.io/tools/#python-3
- https://docs.python.org/3/library/unittest.html
- https://docs.python.org/3/library/unittest.mock.html (python >= 3.3)
- https://docs.python.org/3/library/doctest.html
- https://docs.python.org/3/library/pathlib.html
- testtools
- https://mail.python.org/mailman/listinfo/python-porting
- http://python3porting.com/
- 2to3, six, nine, future
Docs: https://docs.python.org/2/library/2to3.html
Docs: https://docs.python.org/3/library/2to3.html
- https://hg.python.org/cpython/file/tip/Lib/lib2to3/Grammar.txt
- https://pythonhosted.org/setuptools/python3.html#supporting-both-python-2-and-python-3-with-setuptools
PyPI: http://pypi.python.org/pypi/six/
Docs: https://pythonhosted.org/six/
PyPI: https://pypi.python.org/pypi/future
Docs: http://python-future.org/
Homepage: http://ipython.org
Source: https://github.com/ipython/ipython
def test_true(): assert True == True
%logstart log_input_to_here.py
%logstart -o log_input_and_output_to_here.py
%ed log_input_and_output_to_here.py
!nosetests ./log_input_and_output_to_here.py
!nosetests --help
!nosetests --ipdb # pip install ipdbplugin # nose-progressive
# Run a file in IPython's namespace, print timing, skip sys.exit
%run -i -t -e ./log_input_and_output_to_here.py
# Run a file in IPython's namespace, print timing, skip sys.exit, and pdb
%run -i -t -e -d ./log_input_and_output_to_here.py
# Add >>> and ... prompts (useful for recording doctests)
%doctest_mode
# List defined aliases
%alias
# Get help for an alias
%logstart?
%alias?
# List available aliases and commands
%<TAB>
# Run a statement through the Python line profiler
%prun test_true()
%prun (2**2)*2)
# Time a number of loops
%timeit test_true()
%timeit (lambda x: (x**2)*2)(10)
# Run tests (see ipython_nose)
%nose
- https://westurner.github.io/tools/#ipython-notebook
- https://westurner.github.io/tools/#jupyter-notebook
- https://pypi.python.org/pypi/runipy
- ipython_nose
- nosebook
.
- https://github.com/jiffyclub/ipythonblocks
- http://nbviewer.ipython.org/urls/raw.github.com/jiffyclub/ipythonblocks/master/demos/ipythonblocks_animation.ipynb
- https://en.wikipedia.org/wiki/Computer_data_logging
- https://en.wikipedia.org/wiki/Syslog
- http://docs.python.org/2/howto/logging.html
- http://docs.python.org/3/library/logging.config.html
A primer on Python logging (and testing):
#### Logging examples
# test setup (fixtures)
x = 2
data = {'x': x}
# asserts get compiled out with python -O2
assert x == 2
# these always run
class TestTwo(unittest.TestCase):
def test_001_x_equals_2(self):
self.assertEqual(self, x, 2)
unittest.main()
if x != 2:
### Exceptions
err = ('...', x)
raise Exception(err)
raise ValueError(err)
### Logging
import logging
log = logging # global logger
log = __import__('logging') # global logger
log = logging.getLogger(__name__) # local logger (<__name__>.py)
log.debug(err)
log.info(err)
log.error(err)
log.exception(err)
log.critical(err)
log.fatal(err)
# see: supervisor.loggers.LevelsByName and .LevelsByDescription
TRAC = LevelsByName.TRAC = 5
BLAT = LevelsByName.BLAT = 3
log.log(err, TRAC)
logging.addLevelName(TRAC, 'TRAC')
logging.addLevelName(BLAT, 'BLAT')
log.setLevel(TRAC)
log.log(err, BLAT) # not printed because msg.level < log.level
log.log((err, 'string'), BLAT)
# run unittest.main() when run like:
# python ./filename.py
# but not when imported like:
# import filename
if __name__ == "__main__":
import sys
sys.exit(unittest.main())
See also:
PyPI: https://pypi.python.org/pypi/structlog
Docs: https://structlog.readthedocs.org/en/latest/
Docs: http://www.structlog.org/en/stable/
Docs: https://structlog.readthedocs.io/en/stable/logging-best-practices.html#graylog2
Docs: https://structlog.readthedocs.io/en/stable/examples.html
- structlog w/ logbook hynek/structlog#30 (comment)
PyPI: https://pypi.python.org/pypi/logbook
Docs: https://logbook.readthedocs.io/en/stable/
Docs: https://logbook.readthedocs.io/en/stable/features.html
Docs: https://logbook.readthedocs.io/en/stable/designexplained.html
Docs: https://logbook.readthedocs.io/en/stable/quickstart.html#handlers
Logbook is a drop-in replacement for the Python logging module with a number of simplifications and lots of additional handlers.
- MultiProcessingHandler https://logbook.readthedocs.io/en/stable/api/queues.html#logbook.queues.MultiProcessingHandler
- ThreadedWrapperHandler https://logbook.readthedocs.io/en/stable/api/queues.html#logbook.queues.ThreadedWrapperHandler
- structlog w/ logbook hynek/structlog#30 (comment)
Spec: https://en.wikipedia.org/wiki/Syslog#Internet_standard_documents
Docs: https://docs.python.org/3/library/syslog.html
Docs: https://docs.python.org/2/library/logging.handlers.html#sysloghandler
Docs: https://docs.python.org/3/library/logging.handlers.html#sysloghandler
- logging.handlers.SyslogHandler(logging.Handler) blocks
- https://docs.python.org/2/library/logging.handlers.html#sysloghandler
- http://www.somethinkodd.com/oddthinking/2010/04/29/how-python-logging-bit-me-part-1/
- logbook ThreadedWrapperHandler, MultiProcessingHandler
Homepage: http://www.rsyslog.com/
Src: https://github.com/rsyslog/rsyslog
Docs: http://www.rsyslog.com/doc/v8-stable/
- "20.7 Interaction of rsyslog and journal" [journald] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/s1-interaction_of_rsyslog_and_journal.htmlq
Homepage: https://syslog-ng.org/
Src: https://github.com/balabit/syslog-ng
Docs: https://github.com/balabit/syslog-ng#features
Docs: https://www.balabit.com/sites/default/files/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/index.html
PyPI: https://pypi.python.org/pypi/raven
Docs: https://docs.sentry.io/hosted/clients/python/
Docs: https://docs.sentry.io/hosted/clients/python/integrations/
Src: https://github.com/Graylog2/graylog2-server
Src: https://github.com/Graylog2
DockerHub: https://hub.docker.com/r/graylog2/server/
Docs: http://docs.graylog.org/en/latest/
Docs: https://graylog2-docs.readthedocs.io/en/latest/
Docs: https://graylog2-docs.readthedocs.io/en/latest/pages/installation.html
Docs: https://graylog2-docs.readthedocs.io/en/latest/pages/installation/docker.html
- Elasticsearch, MongoDB, Java 8+
GELF (Graylog Extended Log Format)
PyPI: https://pypi.python.org/pypi/graypy
Docs: https://github.com/severb/graypy#using-with-django
- ElasticSearch: storage, indexing, search
- Logstash: logging adapters
- Kibana: ElasticSearch Search UI
Src: https://github.com/elastic/elasticsearch
DockerHub: https://hub.docker.com/_/elasticsearch/
Wrdrddocs: https://wrdrd.github.io/docs/consulting/knowledge-engineering#elasticsearch
Src: https://github.com/elastic/logstash
DockerHub: https://hub.docker.com/_/logstash/
- Logstash GELF Plugin https://www.loggly.com/docs/rsyslog-tls-configuration/
Src: https://www.elastic.co/products/kibana
DockerHub: https://hub.docker.com/_/kibana/
PyPI: https://pypi.python.org/pypi/logstash_formatter
Homepage: https://www.loggly.com/
Docs: https://www.loggly.com/docs/
Docs: https://www.loggly.com/docs/python-logging/
Docs: https://www.loggly.com/docs/python-syslog/
Docs: https://www.loggly.com/docs/rsyslog-tls-configuration/
https://en.wikipedia.org/wiki/Test-driven_development
https://en.wikipedia.org/wiki/Behavior-driven_development
- http://pythonhosted.org/lettuce/
- http://pythonhosted.org/lettuce/tutorial/simple.html
- http://heynemann.github.io/pyvows/
https://en.wikipedia.org/wiki/Mock_object
- http://mock.readthedocs.org/en/latest/index.html
- http://mock.readthedocs.org/en/latest/patch.html
- http://docs.python.org/3/library/unittest.mock.html
PyPI: https://pypi.python.org/pypi/nose
Docs: https://nose.readthedocs.org/en/latest/testing.html
Docs https://nose.readthedocs.org/en/latest/writing_tests.html
nosetests --help
nosetests --with-xunit
# python -m pdb --help
nosetests --pdb
nosetests --pdb-failures
nosetests --pdb-errors
# pip install nose_ipdb
nosetests --ipdb --ipdb-failure
# pip install nose-progressive
nosetests --with-progressive
nose-ipdb is a Nose plugin for running pdb debugger with IPython (so tab completion, obj?
and obj??
all work.
nose-parameterized is a Nose plugin for separating test data from test code.
See also:
PyPI: https://pypi.python.org/pypi/nose-progressive
nose-progressive is a Nose plugin which adds a progress bar, better/different configurable tracebacks, and editor shortcuts
https://github.com/erikrose/nose-progressive#editor-shortcuts
export EDITOR='e'
ipython_nose is a Nose plugin for running test_*
functions within the current Jupyter Notebook.
!pip install -e git+https://github.com/taavi/ipython_nose#egg=ipython_nose
%load_ext ipython_nose
def test_func():
assert sum([1, 1]) == 2
%nose # discover and run "test_*" functions
- nosebook is a Nose plugin for running test functions in Jupyter Notebooks from the CLI.
pip install pdbpp
nosetests --pdb
PyPI: https://pypi.python.org/pypi/pytest
Docs: http://pytest.org/latest/
py.test --pdb # --full-trace
pip install pytest
py.test --pdb
Src: https://github.com/Frozenball/pytest-sugar
PyPI: https://pivotfinland.com/pytest-sugar/
- pytest-sugar adds a progressbar
- See also nose-progressive
PyPI: https://pypi.python.org/pypi/testtools
Docs: https://testing-cabal.github.io/testtools/
Docs: https://testtools.readthedocs.org/en/latest/
Docs: https://testtools.readthedocs.org/en/latest/for-test-authors.html#assertions
Docs: https://testtools.readthedocs.org/en/latest/for-test-authors.html#matchers
Docs: https://testtools.readthedocs.org/en/latest/for-test-authors.html#running-your-tests
- https://en.wikipedia.org/wiki/Continuous_integration
- https://en.wikipedia.org/wiki/Continuous_delivery
- https://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software
- http://docs.python-guide.org/en/latest/scenarios/ci/
Homepage: http://buildbot.net
Src: https://github.com/buildbot/buildbot
PyPI: https://pypi.python.org/pypi/buildbot
PyPI: https://pypi.python.org/pypi/buildbot-slave
Docs: docs.buildbot.net/latest/
Docs: docs.buildbot.net/latest/full.html
- https://github.com/saltstack/salt-jenkins
- https://wiki.jenkins-ci.org/display/JENKINS/ShiningPanda+Plugin
- xUnit XML
- https://nose.readthedocs.org/en/latest/plugins/xunit.html
- http://nosexunit.sourceforge.net/
- https://pytest.org/latest/usage.html#creating-junitxml-format-files
- https://github.com/xmlrunner/unittest-xml-reporting
- https://github.com/zandev/shunit2/compare/master...jeremycarroll:master
- http://about.travis-ci.org/docs/user/getting-started/
- https://github.com/audreyr/cookiecutter-pypackage/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/.travis.yml
- https://en.wikipedia.org/wiki/ACID
- https://en.wikipedia.org/wiki/Patch_(computing)
- https://en.wikipedia.org/wiki/Branching_(revision_control)
- https://en.wikipedia.org/wiki/Merge_(revision_control)
- https://en.wikipedia.org/wiki/Revision_control
- https://en.wikipedia.org/wiki/Distributed_revision_control
- http://savannah.nongnu.org/projects/quilt
- http://www.infoq.com/articles/agile-version-control
- http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
- http://linux.die.net/man/7/guilt
- http://hgbook.red-bean.com/read/advanced-uses-of-mercurial-queues.html
- http://mercurial.selenic.com/wiki/Bookmarks
- https://en.wikipedia.org/wiki/Code_Bisection
- https://www.kernel.org/pub/software/scm/git/docs/git-bisect.html
- https://www.kernel.org/pub/software/scm/git/docs/git-blame.html
- http://git-scm.com/book/en/Git-Tools-Debugging-with-Git
- http://www.selenic.com/mercurial/hg.1.html#bisect
- http://www.selenic.com/mercurial/hg.1.html#annotate
- http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html#sec:undo:bisect
- https://en.wikipedia.org/wiki/Debugging
- https://en.wikipedia.org/wiki/Breakpoint
- https://en.wikipedia.org/wiki/Program_animation
- https://en.wikipedia.org/wiki/Tracing_(software)
- https://en.wikipedia.org/wiki/Fault_injection
- https://en.wikipedia.org/wiki/Probe_effect
- https://scipy-lectures.github.io/advanced/debugging/
Docs: http://docs.python.org/2/library/pdb.html
Docs: http://docs.python.org/3/library/pdb.html
Docs: https://pymotw.com/2/pdb/
Docs: https://pymotw.com/3/pdb/
import pdb; pdb.set_trace() # pdb, pdbpp
import ipdb; ipdb.set_trace() # ipdb
nosetests --ipdb --ipdb-failure # --with-progressive # nose-progressive
pdb++ (pdbpp) is a "drop-in replacement for pdb" with additional debugging commands, tab completion, syntax highlighting, sticky mode,
- When pdb++ is installed (in
sys.path
) pdb++ overloads pdb:
pip install pdbpp funcsigs # installs pdb.py
python -m pdb ./code.py
nosetests --pdb ./code.py
py.test --pdb ./code.py
Docs: https://klen.github.io/python-mode/
Docs: https://github.com/klen/python-mode#source-links
Src: https://github.com/westurner/dotvim/blob/master/vimrc
Src: https://github.com/westurner/dotvim/blob/master/vimrc.full.bundles.vimrc
Src: https://github.com/westurner/dotvim/blob/master/vimrc.tinyvim.bundles.vimrc
Docs: https://westurner.github.io/dotfiles/usage/#vim
- https://dev.launchpad.net/UltimateVimPythonSetup (F7 for set_trace)
- http://wiki.python.org/moin/IntegratedDevelopmentEnvironments#IDEs_with_introspection-based_code_completion_and_integrated_debugger
- http://www.jetbrains.com/pycharm/features/index.html#debugger
- http://www.activestate.com/komodo-ide/features#debugging
- http://pythonhosted.org/spyder/debugging.html
- http://pydev.org/manual_adv_debugger.html
- https://wingware.com/doc/debug
- https://pytools.codeplex.com/
- https://hg.python.org/cpython/file/tip/Tools/gdb/libpython.py
- https://hg.python.org/cpython/file/tip/Misc/README.valgrind
- https://hg.python.org/cpython/file/tip/Misc/valgrind-python.supp
- https://github.com/tmetsch/python-dtrace
- https://github.com/lmacken/pyrasite
- https://github.com/lmacken/pyrasite-gui
- https://github.com/google/pyringe
- https://github.com/alonho/pytrace
- https://github.com/haypo/pytracemalloc
- https://en.wikipedia.org/wiki/Instrumentation_(computer_programming)
- https://en.wikipedia.org/wiki/Profiling_(computer_programming)
- https://en.wikipedia.org/wiki/Call_graph
- https://docs.python.org/2/library/profile.html
- https://github.com/tobami/codespeed/
- https://github.com/numfocus/python-benchmarks
- https://github.com/scikit-learn/scikit-learn/tree/master/benchmarks
- https://github.com/pydata/vbench
- https://github.com/amcfague/linesman
- https://github.com/bdarnell/plop
- http://firelogger.binaryage.com#python
- https://github.com/scikit-learn/ml-benchmarks
- https://github.com/TechEmpower/FrameworkBenchmarks
- https://benchmarksgame.alioth.debian.org/
- http://rosettacode.org/wiki/Category:Programming_Tasks
- https://scipy-lectures.github.io/advanced/optimizing/
- http://pypy.org/performance.html
- http://scikit-learn.org/dev/developers/performance.html
- https://pandas-docs.github.io/pandas-docs-travis/enhancingperf.html
- http://ianozsvald.com/HighPerformancePythonfromTrainingatEuroPython2011_v0.2.pdf
- https://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-6B-HPC.ipynb
- https://en.wikipedia.org/wiki/Test_fixture
- https://factoryboy.readthedocs.org/en/latest/orms.html
- https://docs.djangoproject.com/en/dev/topics/testing/overview/#topics-testing-fixtures
- http://farmdev.com/projects/fixture/
- https://pypi.python.org/pypi/tablib
- https://pypi.python.org/pypi/anyconfig
- https://en.wikipedia.org/wiki/Schema_migration
- https://en.wikipedia.org/wiki/Database_refactoring
- https://en.wikipedia.org/wiki/Database_normalization
https://en.wikipedia.org/wiki/Web_application_framework
- https://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python
- https://www.techempower.com/benchmarks/
Homepage: https://plone.org/
Src: https://github.com/plone/plone
PyPI: https://pypi.python.org/pypi/Plone
Docs: https://plone.org/documentation
Docs: http://developer.plone.org/
Docs: http://docs.plone.org/manage/installing/installation.html
Homepage: https://www.djangoproject.com/
Src: git https://github.com/django/django
PyPI: https://pypi.python.org/pypi/django
Docs: https://docs.djangoproject.com/
Docs: https://docs.djangoproject.com/en/dev/topics/testing/
Docs: https://docs.djangoproject.com/en/dev/topics/settings/
Awesome: https://github.com/rosarior/awesome-django
Homepage: https://flask.pocoo.org/
Src: git https://github.com/mitsuhiko/flask
PyPI: https://pypi.python.org/pypi/Flask
Docs: https://flask.readthedocs.org/en/latest/config/
Docs: https://flask.pocoo.org/docs/latest/
Docs: https://flask.pocoo.org/docs/latest/testing/
Awesome: https://github.com/humiaozuzu/awesome-flask
Src: git https://github.com/bottlepy/bottle
PyPI: https://pypi.python.org/pypi/bottle
Docs: http://bottlepy.org/docs/dev/
Docs: http://bottlepy.org/docs/dev/recipes.html#functional-testing-bottle-applications
Bottle is a one file WSGI Python web framework.
pgs is written with bottle.py:
Homepage: http://www.pylonsproject.org/projects/pyramid/about
Src: git https://github.com/Pylons/pyramid
PyPI: https://pypi.python.org/pypi/pyramid
Docs: http://docs.pylonsproject.org/projects/pyramid/en/latest/
Docs: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/testing.html
Docs: http://docs.pylonsproject.org/projects/pyramid/en/latest/api/testing.html
Awesome: https://github.com/ITCase/awesome-pyramid
PyPI: https://pypi.python.org/pypi/WebTest
Docs: http://webtest.pythonpaste.org/en/latest/
WebTest is a tool for testing WSGI applications without running a webserver (e.g. Pyramid, Flask, Django, Bottle)
PyPI: https://pypi.python.org/pypi/splinter
Docs: https://splinter.readthedocs.org/en/latest/
- multi webdrivers (chrome webdriver, firefox webdriver, phantomjs webdriver, zopetestbrowser, remote webdriver)
- css and xpath selectors *
PyPI: https://pypi.python.org/pypi/Ghost.py
Docs: http://ghost-py.readthedocs.org/en/latest/
Webkit based scriptable web browser for python.
- PyQT or PySide