 A prefix arg will ask for a env to use which is by default what
 specified in `tox-default-env'."
   (interactive "P")
-  (let ((toxenvs (if askenvs
-                     (completing-read
-                      "Tox Environement: " (tox-read-tox-ini-envlist))
-           tox-default-env))
-        (default-directory (tox-get-root-directory))
-        (compilation-auto-jump-to-first-error nil)
-        (compilation-scroll-output nil)
-        (current-function (python-info-current-defun)))
-    (unless current-function
-      (error "No function at point"))
-    (compile (tox-get-command current-function toxenvs)))
-  )
+  (with-tox current askenvs
+     (unless current
+       (error "No function at point"))
+     (compile (tox-get-command current toxenvs))))
 
 ;;;###autoload
 (defun tox-current-class (&optional askenvs)

     ":"
     tox-test))

;;; Public interface ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;###autoload
(defun tox-current-test (&optional askenvs)

A prefix arg will ask for a env to use which is by default what
specified in `tox-default-env'."
  (interactive "P")
  (with-tox current askenvs
     (if current
	 (let ((current-class (car (split-string current "\\."))))
	   (compile (tox-get-command current-class toxenvs)))
       (error "No class at point"))))


;;; End tox.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
