# HG changeset patch # User Augie Fackler # Date 1246552169 18000 # Node ID e83373ab1581fb04af83e4096133564d1236e7bb # Parent b2d9ac793cb0b87b489900e6c8f6f09cb0dc7e16 Latest nosemacs, python menu item for running nose with --failed. diff --git a/.elisp/nose.el b/.elisp/nose.el --- a/.elisp/nose.el +++ b/.elisp/nose.el @@ -57,11 +57,13 @@ (defvar nose-global-name "nosetests") (defvar nose-use-verbose t) -(defun run-nose (&optional tests debug) +(defun run-nose (&optional tests debug failed) "run nosetests" (let* ((nose (nose-find-test-runner)) (where (nose-find-project-root)) - (args (if debug "--pdb" "")) + (args (concat (if debug "--pdb" "") + " " + (if failed "--failed" ""))) (tnames (if tests tests ""))) (funcall (if debug 'pdb @@ -76,10 +78,14 @@ (nose-find-test-runner) args where where tnames))) ) -(defun nosetests-all (&optional debug) +(defun nosetests-all (&optional debug failed) "run all tests" (interactive) - (run-nose nil debug)) + (run-nose nil debug failed)) + +(defun nosetests-failed (&optional debug) + (interactive) + (nosetests-all debug t)) (defun nosetests-pdb-all () (interactive) diff --git a/.elisp/settings/40.modes.el b/.elisp/settings/40.modes.el --- a/.elisp/settings/40.modes.el +++ b/.elisp/settings/40.modes.el @@ -51,6 +51,8 @@ point." (af-tab-fix) (easy-menu-add-item nil '("Python") ["Run All Tests" nosetests-all t] "Comment Out Region") + (easy-menu-add-item nil '("Python") ["Run All Tests with --failed" nosetests-failed t] + "Comment Out Region") (easy-menu-add-item nil '("Python") ["Run Module Tests" nosetests-module t] "Comment Out Region") (easy-menu-add-item nil '("Python") ["Run One Test" nosetests-one t]