comparison .elisp/nose.el @ 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 2563edf11e59
children
comparison
equal deleted inserted replaced
119:b2d9ac793cb0 120:e83373ab1581
55 (defvar nose-project-root-files '("setup.py" ".hg" ".git")) 55 (defvar nose-project-root-files '("setup.py" ".hg" ".git"))
56 (defvar nose-project-root-test 'nose-project-root) 56 (defvar nose-project-root-test 'nose-project-root)
57 (defvar nose-global-name "nosetests") 57 (defvar nose-global-name "nosetests")
58 (defvar nose-use-verbose t) 58 (defvar nose-use-verbose t)
59 59
60 (defun run-nose (&optional tests debug) 60 (defun run-nose (&optional tests debug failed)
61 "run nosetests" 61 "run nosetests"
62 (let* ((nose (nose-find-test-runner)) 62 (let* ((nose (nose-find-test-runner))
63 (where (nose-find-project-root)) 63 (where (nose-find-project-root))
64 (args (if debug "--pdb" "")) 64 (args (concat (if debug "--pdb" "")
65 " "
66 (if failed "--failed" "")))
65 (tnames (if tests tests ""))) 67 (tnames (if tests tests "")))
66 (funcall (if debug 68 (funcall (if debug
67 'pdb 69 'pdb
68 '(lambda (command) 70 '(lambda (command)
69 (compilation-start command 71 (compilation-start command
74 (if nose-use-verbose "-v " "") 76 (if nose-use-verbose "-v " "")
75 "%s -w %s -c %ssetup.cfg %s") 77 "%s -w %s -c %ssetup.cfg %s")
76 (nose-find-test-runner) args where where tnames))) 78 (nose-find-test-runner) args where where tnames)))
77 ) 79 )
78 80
79 (defun nosetests-all (&optional debug) 81 (defun nosetests-all (&optional debug failed)
80 "run all tests" 82 "run all tests"
81 (interactive) 83 (interactive)
82 (run-nose nil debug)) 84 (run-nose nil debug failed))
85
86 (defun nosetests-failed (&optional debug)
87 (interactive)
88 (nosetests-all debug t))
83 89
84 (defun nosetests-pdb-all () 90 (defun nosetests-pdb-all ()
85 (interactive) 91 (interactive)
86 (nosetests-all t)) 92 (nosetests-all t))
87 93