diff options
author | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2014-12-27 20:12:00 -0300 |
---|---|---|
committer | Fabián Ezequiel Gallina <fgallina@gnu.org> | 2014-12-27 20:12:00 -0300 |
commit | 7d1e62d51b51be27b11a67d7828b77f2df9e1eb1 (patch) | |
tree | 8404c3b50203c55b9cbffdbe0e0553311ff7df22 /test/automated | |
parent | 996ad1b846a0865245df008bdb551093278b3c30 (diff) | |
download | emacs-7d1e62d51b51be27b11a67d7828b77f2df9e1eb1.tar.gz |
python.el: Enhance shell user interaction and deprecate python-shell-get-or-create-process.
* lisp/progmodes/python.el
(python-shell-get-process-or-error): New function.
(python-shell-with-shell-buffer): Use it.
(python-shell-send-string, python-shell-send-region)
(python-shell-send-buffer, python-shell-send-defun)
(python-shell-send-file, python-shell-switch-to-shell): Use it.
Add argument MSG to display user-friendly message when no process
is running.
(python-shell-switch-to-shell): Call pop-to-buffer with NORECORD.
(python-shell-make-comint): Rename argument SHOW from POP. Use
display-buffer instead of pop-to-buffer.
(run-python): Doc fix. Return process.
(python-shell-get-or-create-process): Make obsolete.
* test/automated/python-tests.el (python-shell-get-or-create-process-1)
(python-shell-get-or-create-process-2)
(python-shell-get-or-create-process-3): Remove tests.
Diffstat (limited to 'test/automated')
-rw-r--r-- | test/automated/python-tests.el | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index a6ed6808182..90fa79ee966 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -2083,84 +2083,6 @@ and `python-shell-interpreter-args' in the new shell buffer." (ignore-errors (kill-buffer global-shell-buffer)) (ignore-errors (kill-buffer dedicated-shell-buffer)))))) -(ert-deftest python-shell-get-or-create-process-1 () - "Check shell dedicated process creation." - (skip-unless (executable-find python-tests-shell-interpreter)) - (python-tests-with-temp-file - "" - (let* ((cmd - (concat (executable-find python-tests-shell-interpreter) " -i")) - (use-dialog-box) - (dedicated-process-name (python-shell-get-process-name t)) - (dedicated-process (python-shell-get-or-create-process cmd t)) - (dedicated-shell-buffer (process-buffer dedicated-process))) - (unwind-protect - (progn - (set-process-query-on-exit-flag dedicated-process nil) - ;; should be dedicated. - (should (equal (process-name dedicated-process) - dedicated-process-name)) - (kill-buffer dedicated-shell-buffer) - ;; Check there are no processes for current buffer. - (should (not (python-shell-get-process)))) - (ignore-errors (kill-buffer dedicated-shell-buffer)))))) - -(ert-deftest python-shell-get-or-create-process-2 () - "Check shell global process creation." - (skip-unless (executable-find python-tests-shell-interpreter)) - (python-tests-with-temp-file - "" - (let* ((cmd - (concat (executable-find python-tests-shell-interpreter) " -i")) - (use-dialog-box) - (process-name (python-shell-get-process-name nil)) - (process (python-shell-get-or-create-process cmd)) - (shell-buffer (process-buffer process))) - (unwind-protect - (progn - (set-process-query-on-exit-flag process nil) - ;; should be global. - (should (equal (process-name process) process-name)) - (kill-buffer shell-buffer) - ;; Check there are no processes for current buffer. - (should (not (python-shell-get-process)))) - (ignore-errors (kill-buffer shell-buffer)))))) - -(ert-deftest python-shell-get-or-create-process-3 () - "Check shell dedicated/global process preference." - (skip-unless (executable-find python-tests-shell-interpreter)) - (python-tests-with-temp-file - "" - (let* ((cmd - (concat (executable-find python-tests-shell-interpreter) " -i")) - (python-shell-interpreter python-tests-shell-interpreter) - (use-dialog-box) - (dedicated-process-name (python-shell-get-process-name t)) - (global-process) - (dedicated-process)) - (progn - ;; Create global process - (run-python cmd nil) - (setq global-process (get-buffer-process "*Python*")) - (should global-process) - (set-process-query-on-exit-flag global-process nil) - ;; Create dedicated process - (run-python cmd t) - (setq dedicated-process (get-process dedicated-process-name)) - (should dedicated-process) - (set-process-query-on-exit-flag dedicated-process nil) - ;; Prefer dedicated. - (should (equal (python-shell-get-or-create-process) - dedicated-process)) - ;; Kill the dedicated so the global takes over. - (kill-buffer (process-buffer dedicated-process)) - ;; Detect global. - (should (equal (python-shell-get-or-create-process) global-process)) - ;; Kill the global. - (kill-buffer (process-buffer global-process)) - ;; Check there are no processes for current buffer. - (should (not (python-shell-get-process))))))) - (ert-deftest python-shell-internal-get-or-create-process-1 () "Check internal shell process creation fallback." (skip-unless (executable-find python-tests-shell-interpreter)) |