* lisp/progmodes/python.el (python-indent-calculate-indentation): When
determining indentation, don't treat "return", "pass", etc., as operators when they are just string constituents. * automated/python-test.el (python-indent-block-enders-1): Rename from python-indent-block-enders. (python-indent-block-enders-2): New test. Fixes: debbugs:15812
This commit is contained in:
parent
6cc4c89b6c
commit
f54de22e65
4 changed files with 35 additions and 2 deletions
|
@ -447,7 +447,7 @@ objects = Thing.objects.all() \\\\
|
|||
(should (eq (car (python-indent-context)) 'after-line))
|
||||
(should (= (python-indent-calculate-indentation) 0))))
|
||||
|
||||
(ert-deftest python-indent-block-enders ()
|
||||
(ert-deftest python-indent-block-enders-1 ()
|
||||
"Test `python-indent-block-enders' value honoring."
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
|
@ -469,6 +469,27 @@ Class foo(object):
|
|||
(forward-line 1)
|
||||
(should (= (python-indent-calculate-indentation) 8))))
|
||||
|
||||
(ert-deftest python-indent-block-enders-2 ()
|
||||
"Test `python-indent-block-enders' value honoring."
|
||||
(python-tests-with-temp-buffer
|
||||
"
|
||||
Class foo(object):
|
||||
'''raise lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
||||
|
||||
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
'''
|
||||
def bar(self):
|
||||
\"return (1, 2, 3).\"
|
||||
if self.baz:
|
||||
return (1,
|
||||
2,
|
||||
3)
|
||||
"
|
||||
(python-tests-look-at "def")
|
||||
(should (= (python-indent-calculate-indentation) 4))
|
||||
(python-tests-look-at "if")
|
||||
(should (= (python-indent-calculate-indentation) 8))))
|
||||
|
||||
|
||||
;;; Navigation
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue