aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/progmodes/python-tests.el
diff options
context:
space:
mode:
authorStefan Kangas2020-04-28 13:54:00 +0200
committerStefan Kangas2020-04-28 13:54:00 +0200
commit771a6b68165b986b6bf9249c57ca11d310b0f0e4 (patch)
treee28a8c72064a8b867d9d97461e57dc99ed22219d /test/lisp/progmodes/python-tests.el
parent725256d0030aa72617dc8963e7582e53f9e02674 (diff)
downloademacs-771a6b68165b986b6bf9249c57ca11d310b0f0e4.tar.gz
emacs-771a6b68165b986b6bf9249c57ca11d310b0f0e4.zip
Use lexical-binding in most progmodes tests
* test/lisp/progmodes/etags-tests.el: * test/lisp/progmodes/f90-tests.el: * test/lisp/progmodes/ps-mode-tests.el: * test/lisp/progmodes/python-tests.el: * test/lisp/progmodes/ruby-mode-tests.el: * test/lisp/progmodes/subword-tests.el: * test/lisp/progmodes/tcl-tests.el: * test/lisp/progmodes/xref-tests.el: Use lexical-binding. * test/lisp/progmodes/python-tests.el (python-tests-visible-string) (python-tests-look-at-1, python-tests-look-at-2) (python-shell-calculate-process-environment-2): Silence byte-compiler.
Diffstat (limited to 'test/lisp/progmodes/python-tests.el')
-rw-r--r--test/lisp/progmodes/python-tests.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 65a60b4c32c..60cd6ea996e 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1,4 +1,4 @@
1;;; python-tests.el --- Test suite for python.el 1;;; python-tests.el --- Test suite for python.el -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2013-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
4 4
@@ -118,7 +118,6 @@ Argument MIN and MAX delimit the region to be returned and
118default to `point-min' and `point-max' respectively." 118default to `point-min' and `point-max' respectively."
119 (let* ((min (or min (point-min))) 119 (let* ((min (or min (point-min)))
120 (max (or max (point-max))) 120 (max (or max (point-max)))
121 (buffer (current-buffer))
122 (buffer-contents (buffer-substring-no-properties min max)) 121 (buffer-contents (buffer-substring-no-properties min max))
123 (overlays 122 (overlays
124 (sort (overlays-in min max) 123 (sort (overlays-in min max)
@@ -154,7 +153,7 @@ The name of this directory depends on `system-type'."
154sed do eiusmod tempor incididunt ut labore et dolore magna 153sed do eiusmod tempor incididunt ut labore et dolore magna
155aliqua." 154aliqua."
156 (let ((expected (save-excursion 155 (let ((expected (save-excursion
157 (dotimes (i 3) 156 (dotimes (_ 3)
158 (re-search-forward "et" nil t)) 157 (re-search-forward "et" nil t))
159 (forward-char -2) 158 (forward-char -2)
160 (point)))) 159 (point))))
@@ -163,7 +162,7 @@ aliqua."
163 ;; one should be returned. 162 ;; one should be returned.
164 (should (= (python-tests-look-at "et" 6 t) expected)) 163 (should (= (python-tests-look-at "et" 6 t) expected))
165 ;; If already looking at STRING, it should skip it. 164 ;; If already looking at STRING, it should skip it.
166 (dotimes (i 2) (re-search-forward "et")) 165 (dotimes (_ 2) (re-search-forward "et"))
167 (forward-char -2) 166 (forward-char -2)
168 (should (= (python-tests-look-at "et") expected))))) 167 (should (= (python-tests-look-at "et") expected)))))
169 168
@@ -178,7 +177,7 @@ aliqua."
178 (re-search-forward "et" nil t) 177 (re-search-forward "et" nil t)
179 (forward-char -2) 178 (forward-char -2)
180 (point)))) 179 (point))))
181 (dotimes (i 3) 180 (dotimes (_ 3)
182 (re-search-forward "et" nil t)) 181 (re-search-forward "et" nil t))
183 (should (= (python-tests-look-at "et" -3 t) expected)) 182 (should (= (python-tests-look-at "et" -3 t) expected))
184 (should (= (python-tests-look-at "et" -6 t) expected))))) 183 (should (= (python-tests-look-at "et" -6 t) expected)))))
@@ -2642,7 +2641,7 @@ if x:
2642(ert-deftest python-shell-calculate-process-environment-2 () 2641(ert-deftest python-shell-calculate-process-environment-2 ()
2643 "Test `python-shell-extra-pythonpaths' modification." 2642 "Test `python-shell-extra-pythonpaths' modification."
2644 (let* ((process-environment process-environment) 2643 (let* ((process-environment process-environment)
2645 (original-pythonpath (setenv "PYTHONPATH" "/path0")) 2644 (_original-pythonpath (setenv "PYTHONPATH" "/path0"))
2646 (python-shell-extra-pythonpaths '("/path1" "/path2")) 2645 (python-shell-extra-pythonpaths '("/path1" "/path2"))
2647 (process-environment (python-shell-calculate-process-environment))) 2646 (process-environment (python-shell-calculate-process-environment)))
2648 (should (equal (getenv "PYTHONPATH") 2647 (should (equal (getenv "PYTHONPATH")