1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-31 20:02:42 +00:00

* python-tests.el (python-tests-with-temp-file): Clean up after ourself

This commit is contained in:
Glenn Morris 2013-06-26 22:46:51 -07:00
parent 99906aa0d9
commit df86ba7d4d
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2013-06-27 Glenn Morris <rgm@gnu.org>
* automated/python-tests.el (python-tests-with-temp-file):
Clean up after ourself.
* automated/undo-tests.el (undo-test3): Remove test that seems to
do nothing that the previous one doesn't, except leave a tempfile.

View File

@ -39,7 +39,8 @@ always located at the beginning of buffer."
BODY is code to be executed within the temp buffer. Point is
always located at the beginning of buffer."
(declare (indent 1) (debug t))
`(let* ((temp-file (concat (make-temp-file "python-tests") ".py"))
;; temp-file never actually used for anything?
`(let* ((temp-file (make-temp-file "python-tests" nil ".py"))
(buffer (find-file-noselect temp-file)))
(unwind-protect
(with-current-buffer buffer
@ -47,7 +48,8 @@ always located at the beginning of buffer."
(insert ,contents)
(goto-char (point-min))
,@body)
(and buffer (kill-buffer buffer)))))
(and buffer (kill-buffer buffer))
(delete-file temp-file))))
(defun python-tests-look-at (string &optional num restore-point)
"Move point at beginning of STRING in the current buffer.