aboutsummaryrefslogtreecommitdiffstats
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.el27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index e3b1642a975..889038d0f8c 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -7466,6 +7466,33 @@ buffer with overlapping strings."
7466 "Unused import a.b.c (unused-import)" 7466 "Unused import a.b.c (unused-import)"
7467 "W0611: Unused import a.b.c (unused-import)")))))) 7467 "W0611: Unused import a.b.c (unused-import)"))))))
7468 7468
7469(ert-deftest python-test--shell-send-block ()
7470 (skip-unless (executable-find python-tests-shell-interpreter))
7471 (python-tests-with-temp-buffer-with-shell
7472 "print('current 0')
7473for x in range(1,3):
7474 print('current %s' % x)
7475print('current 3')"
7476 (goto-line 1)
7477 (should-error (python-shell-send-block) :type 'user-error)
7478 (goto-line 2)
7479 (python-shell-send-block)
7480 (python-tests-shell-wait-for-prompt)
7481 (python-shell-with-shell-buffer
7482 (goto-char (point-min))
7483 (should-not (re-search-forward "current 0" nil t))
7484 (should (re-search-forward "current 1" nil t))
7485 (should (re-search-forward "current 2" nil t))
7486 (should-not (re-search-forward "current 3" nil t)))
7487 (goto-line 3)
7488 (python-shell-send-block t) ;; send block body only
7489 (python-tests-shell-wait-for-prompt)
7490 (python-shell-with-shell-buffer
7491 ;; should only 1 line output from the block body
7492 (should (re-search-forward "current"))
7493 (should (looking-at " 2"))
7494 (should-not (re-search-forward "current" nil t)))))
7495
7469;;; python-ts-mode font-lock tests 7496;;; python-ts-mode font-lock tests
7470 7497
7471(defmacro python-ts-tests-with-temp-buffer (contents &rest body) 7498(defmacro python-ts-tests-with-temp-buffer (contents &rest body)