aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris2013-06-26 22:46:51 -0700
committerGlenn Morris2013-06-26 22:46:51 -0700
commitdf86ba7d4da45d3fdcd3a01969e58203f2762844 (patch)
tree8bf45f4f6874563252e708005a491f38cedb3302 /test
parent99906aa0d923b39dcc1f8978367c65146e47937d (diff)
downloademacs-df86ba7d4da45d3fdcd3a01969e58203f2762844.tar.gz
emacs-df86ba7d4da45d3fdcd3a01969e58203f2762844.zip
* python-tests.el (python-tests-with-temp-file): Clean up after ourself
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog3
-rw-r--r--test/automated/python-tests.el6
2 files changed, 7 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 7238e625c88..d3bd3d673cf 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,5 +1,8 @@
12013-06-27 Glenn Morris <rgm@gnu.org> 12013-06-27 Glenn Morris <rgm@gnu.org>
2 2
3 * automated/python-tests.el (python-tests-with-temp-file):
4 Clean up after ourself.
5
3 * automated/undo-tests.el (undo-test3): Remove test that seems to 6 * automated/undo-tests.el (undo-test3): Remove test that seems to
4 do nothing that the previous one doesn't, except leave a tempfile. 7 do nothing that the previous one doesn't, except leave a tempfile.
5 8
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el
index 8462a863b84..40505cc7953 100644
--- a/test/automated/python-tests.el
+++ b/test/automated/python-tests.el
@@ -39,7 +39,8 @@ always located at the beginning of buffer."
39BODY is code to be executed within the temp buffer. Point is 39BODY is code to be executed within the temp buffer. Point is
40always located at the beginning of buffer." 40always located at the beginning of buffer."
41 (declare (indent 1) (debug t)) 41 (declare (indent 1) (debug t))
42 `(let* ((temp-file (concat (make-temp-file "python-tests") ".py")) 42 ;; temp-file never actually used for anything?
43 `(let* ((temp-file (make-temp-file "python-tests" nil ".py"))
43 (buffer (find-file-noselect temp-file))) 44 (buffer (find-file-noselect temp-file)))
44 (unwind-protect 45 (unwind-protect
45 (with-current-buffer buffer 46 (with-current-buffer buffer
@@ -47,7 +48,8 @@ always located at the beginning of buffer."
47 (insert ,contents) 48 (insert ,contents)
48 (goto-char (point-min)) 49 (goto-char (point-min))
49 ,@body) 50 ,@body)
50 (and buffer (kill-buffer buffer))))) 51 (and buffer (kill-buffer buffer))
52 (delete-file temp-file))))
51 53
52(defun python-tests-look-at (string &optional num restore-point) 54(defun python-tests-look-at (string &optional num restore-point)
53 "Move point at beginning of STRING in the current buffer. 55 "Move point at beginning of STRING in the current buffer.