changeset 120:e83373ab1581

Latest nosemacs, python menu item for running nose with --failed.
author Augie Fackler <durin42@gmail.com>
date Thu, 02 Jul 2009 11:29:29 -0500
parents b2d9ac793cb0
children 8989839d4c6c
files .elisp/nose.el .elisp/settings/40.modes.el
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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]