Comment 3 for bug 1072869

Revision history for this message
Yaroslav Halchenko (yarikoptic) wrote : Re: [Bug 1072869] Re: does not dedent regions/buffer all the way before 'exec'

interesting ;)

so -- if I load-library and just invoke
does-not-dedent-regions-lp-1072869-test

it reports that it passes:

does-not-dedent-regions-lp-1072869-test passed

BUT then if I dig out and find *Python* buffer there I see plenty of (this one
is already modified by me to be (let ((teststring " print
\"HELLO\"\n")) but the same happens with original one):

Python 2.7.3 (default, Aug 26 2012, 11:57:48)
[GCC 4.7.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yoh/.tmp/python-22782Hwp.py", line 4
    print "HELLO"
    ^
IndentationError: unexpected indent
>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yoh/.tmp/python-22782U6v.py", line 4
    print "HELLO"
    ^
IndentationError: unexpected indent
>>>

so I guess the "Tester" needs to be tuned up to catch those failures

also FWIW if I run all (py-bug-numbered-tests)

leads me to interactive debugger with

Debugger entered--Lisp error: (error "exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed")
  signal(error ("exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed"))
  error("exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed")
  (or (eq (get-char-property ... ...) (quote font-lock-keyword-face)) (error "exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed"))
  (progn (or (eq ... ...) (error "exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed")) nil)
  (assert (eq (get-char-property ... ...) (quote font-lock-keyword-face)) nil "exception-in-except-clause-highlighted-as-keyword-lp-909205-test #1 failed")
  exception-in-except-clause-highlighted-as-keyword-lp-909205-base()
  funcall(exception-in-except-clause-highlighted-as-keyword-lp-909205-base)
  (let ((debug-on-error t) (enable-local-variables :all) py-load-pymacs-p py-split-windows-on-execute-p py-shell-switch-buffers-on-execute-p py-start-run-py-shell proc py-fontify-shell-buffer-p) (if nil (find-file ...) (set-buffer ...)) (switch-to-buffer (current-buffer)) (delete-other-windows) (erase-buffer) (fundamental-mode) (insert teststring) (local-unset-key (kbd "RET")) (python-mode) (when (and ... company-mode) (company-abort)) (funcall (quote exception-in-except-clause-highlighted-as-keyword-lp-909205-base)) (message "%s" (replace-regexp-in-string "\\\\" "" ...)) (unless (< 1 arg) (set-buffer-modified-p ...) (and ... ... ...) (kill-buffer ...)))
  (py-bug-tests-intern (quote exception-in-except-clause-highlighted-as-keyword-lp-909205-base) arg teststring)
  (let ((teststring "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\ntry:\n blah\nexcept ormexc.NoResultFound:\n pass\n")) (py-bug-tests-intern (quote exception-in-except-clause-highlighted-as-keyword-lp-909205-base) arg teststring))
  exception-in-except-clause-highlighted-as-keyword-lp-909205-test(1)
  funcall(exception-in-except-clause-highlighted-as-keyword-lp-909205-test 1)
  (while --cl-dolist-temp-- (setq ele (car --cl-dolist-temp--)) (funcall ele arg) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))
  (let ((--cl-dolist-temp-- bug-numbered-tests) ele) (while --cl-dolist-temp-- (setq ele ...) (funcall ele arg) (setq --cl-dolist-temp-- ...)) nil)
  (catch (quote --cl-block-nil--) (let (... ele) (while --cl-dolist-temp-- ... ... ...) nil))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let ... ... nil)))
  (block nil (let (... ele) (while --cl-dolist-temp-- ... ... ...) nil))
  (dolist (ele bug-numbered-tests) (funcall ele arg))
  py-run-bug-numbered-tests(1)
  call-interactively(py-run-bug-numbered-tests t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

and *Messages*

Loading /home/yoh/deb/gits/python-mode.bzr2/test/py-bug-numbered-tests.el (source)...done
Mark set
incorrect-indentation-of-one-line-functions-lp-1067633-test passed
Mark set [2 times]
several-new-bugs-with-paragraph-filling-lp-1066489-test passed
Wrote /home/yoh/.tmp/python-22782fXE.py
impossible-to-execute-a-buffer-with-from-future-imports-lp-1063884-test passed
Entering debugger...

> may you run the test with the resp. number from test/py-bug-numbered-tests.el
> ?

> Does that work for you?
--
Yaroslav O. Halchenko
Postdoctoral Fellow, Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419
WWW: http://www.linkedin.com/in/yarik