Tools ===== unittest2 --------- - Just a backport of the ``unittest`` stuff in Python 2.7+ to Python 2.6 and previous. doctest ------- - A way of testing Python code via docstrings and snippets in text files. https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/tests/testfsIndex.py#L197 nose ---- - An alternate test runner for unittest and nose-specific tests. .. code-block:: bash $ pip install nose $ nosetests sample https://nose.readthedocs.org/en/latest/ py.test ------- - An alternate test runner for unittest and pytest-specific tests. .. code-block:: bash $ pip install pytest $ py.test --pyargs sample http://pytest.org/latest/getting-started.html tox --- - A way to test code under multiple versions of Python. https://testrun.org/tox/latest/ Pyramid's use of tox: https://github.com/Pylons/pyramid/blob/master/tox.ini detox ------ - A parallel tox. https://pypi.python.org/pypi/detox/ sphinx testing integration -------------------------- - Doctest using plugin. http://sphinx-doc.org/ext/doctest.html git bisect ---------- - Track down the commit that caused an issue. http://www.sitepoint.com/automate-debugging-git-unit-tests/ Condition/Decision coverage --------------------------- Instrumental: https://pypi.python.org/pypi/instrumental .. code-block:: python >>> def foo(a): ... return a == True or 2 ... >>> print foo(False) 2 >>> print foo(True) True Continuous Integration ====================== Travis ------ Pyramid's usage. Jenkins ------- Pylons Project usage. Common Test Problems and Their Solutions ======================================== SQLAlchemy databases -------------------- http://www.sontek.net/blog/2011/12/01/writing_tests_for_pyramid_and_sqlalchemy.html Mongo databases --------------- https://github.com/theorm/mongobox Pyramid configuration --------------------- https://github.com/Pylons/substanced/blob/master/substanced/sdi/tests/test_sdi.py#L819 Workshop (second half of day) ============================= Bring Your Own Code! --------------------