aboutsummaryrefslogtreecommitdiffstats
path: root/test/automated/python-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/automated/python-tests.el')
-rw-r--r--test/automated/python-tests.el78
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."
2083 (ignore-errors (kill-buffer global-shell-buffer)) 2083 (ignore-errors (kill-buffer global-shell-buffer))
2084 (ignore-errors (kill-buffer dedicated-shell-buffer)))))) 2084 (ignore-errors (kill-buffer dedicated-shell-buffer))))))
2085 2085
2086(ert-deftest python-shell-get-or-create-process-1 ()
2087 "Check shell dedicated process creation."
2088 (skip-unless (executable-find python-tests-shell-interpreter))
2089 (python-tests-with-temp-file
2090 ""
2091 (let* ((cmd
2092 (concat (executable-find python-tests-shell-interpreter) " -i"))
2093 (use-dialog-box)
2094 (dedicated-process-name (python-shell-get-process-name t))
2095 (dedicated-process (python-shell-get-or-create-process cmd t))
2096 (dedicated-shell-buffer (process-buffer dedicated-process)))
2097 (unwind-protect
2098 (progn
2099 (set-process-query-on-exit-flag dedicated-process nil)
2100 ;; should be dedicated.
2101 (should (equal (process-name dedicated-process)
2102 dedicated-process-name))
2103 (kill-buffer dedicated-shell-buffer)
2104 ;; Check there are no processes for current buffer.
2105 (should (not (python-shell-get-process))))
2106 (ignore-errors (kill-buffer dedicated-shell-buffer))))))
2107
2108(ert-deftest python-shell-get-or-create-process-2 ()
2109 "Check shell global process creation."
2110 (skip-unless (executable-find python-tests-shell-interpreter))
2111 (python-tests-with-temp-file
2112 ""
2113 (let* ((cmd
2114 (concat (executable-find python-tests-shell-interpreter) " -i"))
2115 (use-dialog-box)
2116 (process-name (python-shell-get-process-name nil))
2117 (process (python-shell-get-or-create-process cmd))
2118 (shell-buffer (process-buffer process)))
2119 (unwind-protect
2120 (progn
2121 (set-process-query-on-exit-flag process nil)
2122 ;; should be global.
2123 (should (equal (process-name process) process-name))
2124 (kill-buffer shell-buffer)
2125 ;; Check there are no processes for current buffer.
2126 (should (not (python-shell-get-process))))
2127 (ignore-errors (kill-buffer shell-buffer))))))
2128
2129(ert-deftest python-shell-get-or-create-process-3 ()
2130 "Check shell dedicated/global process preference."
2131 (skip-unless (executable-find python-tests-shell-interpreter))
2132 (python-tests-with-temp-file
2133 ""
2134 (let* ((cmd
2135 (concat (executable-find python-tests-shell-interpreter) " -i"))
2136 (python-shell-interpreter python-tests-shell-interpreter)
2137 (use-dialog-box)
2138 (dedicated-process-name (python-shell-get-process-name t))
2139 (global-process)
2140 (dedicated-process))
2141 (progn
2142 ;; Create global process
2143 (run-python cmd nil)
2144 (setq global-process (get-buffer-process "*Python*"))
2145 (should global-process)
2146 (set-process-query-on-exit-flag global-process nil)
2147 ;; Create dedicated process
2148 (run-python cmd t)
2149 (setq dedicated-process (get-process dedicated-process-name))
2150 (should dedicated-process)
2151 (set-process-query-on-exit-flag dedicated-process nil)
2152 ;; Prefer dedicated.
2153 (should (equal (python-shell-get-or-create-process)
2154 dedicated-process))
2155 ;; Kill the dedicated so the global takes over.
2156 (kill-buffer (process-buffer dedicated-process))
2157 ;; Detect global.
2158 (should (equal (python-shell-get-or-create-process) global-process))
2159 ;; Kill the global.
2160 (kill-buffer (process-buffer global-process))
2161 ;; Check there are no processes for current buffer.
2162 (should (not (python-shell-get-process)))))))
2163
2164(ert-deftest python-shell-internal-get-or-create-process-1 () 2086(ert-deftest python-shell-internal-get-or-create-process-1 ()
2165 "Check internal shell process creation fallback." 2087 "Check internal shell process creation fallback."
2166 (skip-unless (executable-find python-tests-shell-interpreter)) 2088 (skip-unless (executable-find python-tests-shell-interpreter))