From 0dd43313b6ca007fbe372b44f36fc641bb13e6cb Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Thu, 18 Dec 2014 21:27:12 -0800 Subject: python: nosetests --- software/python.page | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'software') diff --git a/software/python.page b/software/python.page index 05b584d..cd1fb0b 100644 --- a/software/python.page +++ b/software/python.page @@ -98,3 +98,19 @@ RunSnakeRun $ python -m cProfile -o ./dump.profile myscript.py --script-option blah $ # run to completion or Ctrl-C, then $ runsnakerun ./dump.profile + +nosetests +------------- + +To do minimal tests without wrapping everything in a class, import assert +functions from nose.tools, eg: + + from nose.tools import assert_raises, assert_equal + +To do interactive pdb debugging, simply: + + $ nosetests --pdb + # or sometimes: + $ nosetests --pdb-failures + + -- cgit v1.2.3