summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el49
1 files changed, 33 insertions, 16 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index f76ecbbd3d4..010eb67160c 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -15,7 +15,7 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -1109,6 +1109,37 @@ def fn(a, b, c=True):
(should (eq (car (python-indent-context)) :inside-string))
(should (= (python-indent-calculate-indentation) 4))))
+(ert-deftest python-indent-electric-comma-inside-multiline-string ()
+ "Test indentation ...."
+ (python-tests-with-temp-buffer
+ "
+a = (
+ '''\
+- foo,
+- bar
+'''
+"
+ (python-tests-look-at "- bar")
+ (should (eq (car (python-indent-context)) :inside-string))
+ (goto-char (line-end-position))
+ (python-tests-self-insert ",")
+ (should (= (current-indentation) 0))))
+
+(ert-deftest python-indent-electric-comma-after-multiline-string ()
+ "Test indentation ...."
+ (python-tests-with-temp-buffer
+ "
+a = (
+ '''\
+- foo,
+- bar'''
+"
+ (python-tests-look-at "- bar'''")
+ (should (eq (car (python-indent-context)) :inside-string))
+ (goto-char (line-end-position))
+ (python-tests-self-insert ",")
+ (should (= (current-indentation) 0))))
+
(ert-deftest python-indent-electric-colon-1 ()
"Test indentation case from Bug#18228."
(python-tests-with-temp-buffer
@@ -2522,20 +2553,6 @@ if x:
(should (string= (python-shell-internal-get-process-name)
(format "%s[%s]" python-shell-internal-buffer-name (buffer-name))))))
-(ert-deftest python-shell-calculate-command-1 ()
- "Check the command to execute is calculated correctly.
-Using `python-shell-interpreter' and
-`python-shell-interpreter-args'."
- (skip-unless (executable-find python-tests-shell-interpreter))
- (let ((python-shell-interpreter (executable-find
- python-tests-shell-interpreter))
- (python-shell-interpreter-args "-B"))
- (should (string=
- (format "%s %s"
- (shell-quote-argument python-shell-interpreter)
- python-shell-interpreter-args)
- (python-shell-calculate-command)))))
-
(ert-deftest python-shell-calculate-pythonpath-1 ()
"Test PYTHONPATH calculation."
(let ((process-environment '("PYTHONPATH=/path0"))
@@ -2575,7 +2592,7 @@ Using `python-shell-interpreter' and
"Test `python-shell-virtualenv-root' modification."
(let* ((python-shell-virtualenv-root "/env")
(process-environment
- (let (process-environment process-environment)
+ (let ((process-environment process-environment))
(setenv "PYTHONHOME" "/home")
(setenv "VIRTUAL_ENV")
(python-shell-calculate-process-environment))))