]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/automated/python-tests.el: Avoid warnings
authorJuanma Barranquero <lekktu@gmail.com>
Sun, 1 Nov 2015 00:17:16 +0000 (01:17 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Sun, 1 Nov 2015 00:17:16 +0000 (01:17 +0100)
(python-tests-with-temp-buffer, python-tests-with-temp-file):
Bind `python-indent-guess-indent-offset' to nil.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes to be committed:
# modified:   test/automated/python-tests.el
#

test/automated/python-tests.el

index 44b05e2b476362c439143c19128a53ed62122eb6..f930ffba302704d23444431d93d450490afef611 100644 (file)
@@ -36,10 +36,11 @@ BODY is code to be executed within the temp buffer.  Point is
 always located at the beginning of buffer."
   (declare (indent 1) (debug t))
   `(with-temp-buffer
-     (python-mode)
-     (insert ,contents)
-     (goto-char (point-min))
-     ,@body))
+     (let ((python-indent-guess-indent-offset nil))
+       (python-mode)
+       (insert ,contents)
+       (goto-char (point-min))
+       ,@body)))
 
 (defmacro python-tests-with-temp-file (contents &rest body)
   "Create a `python-mode' enabled file with CONTENTS.
@@ -48,7 +49,8 @@ always located at the beginning of buffer."
   (declare (indent 1) (debug t))
   ;; temp-file never actually used for anything?
   `(let* ((temp-file (make-temp-file "python-tests" nil ".py"))
-          (buffer (find-file-noselect temp-file)))
+          (buffer (find-file-noselect temp-file))
+          (python-indent-guess-indent-offset nil))
      (unwind-protect
          (with-current-buffer buffer
            (python-mode)