From 0147c24bb2eff6dc2dbba4eb0edec84dcc2be942 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Fri, 24 Jan 2014 21:28:09 +0100 Subject: [PATCH] Added test for PY-11337 --- python/testData/formatter/alignInNestedCallInWith.py | 10 ++++++++++ .../formatter/alignInNestedCallInWith_after.py | 10 ++++++++++ .../com/jetbrains/python/PyFormatterTest.java | 12 ++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 python/testData/formatter/alignInNestedCallInWith.py create mode 100644 python/testData/formatter/alignInNestedCallInWith_after.py diff --git a/python/testData/formatter/alignInNestedCallInWith.py b/python/testData/formatter/alignInNestedCallInWith.py new file mode 100644 index 000000000000..ccf3783844a0 --- /dev/null +++ b/python/testData/formatter/alignInNestedCallInWith.py @@ -0,0 +1,10 @@ +import logging +from nose.tools import assert_raises_regex + + +def _assert_stuff(i): + with assert_raises_regex( + logging.INFO, + 'Did stuff to {} because of reasons that take up a whole line of text'.format( + i.relname)): + pass \ No newline at end of file diff --git a/python/testData/formatter/alignInNestedCallInWith_after.py b/python/testData/formatter/alignInNestedCallInWith_after.py new file mode 100644 index 000000000000..b64caa7c7e1c --- /dev/null +++ b/python/testData/formatter/alignInNestedCallInWith_after.py @@ -0,0 +1,10 @@ +import logging +from nose.tools import assert_raises_regex + + +def _assert_stuff(i): + with assert_raises_regex( + logging.INFO, + 'Did stuff to {} because of reasons that take up a whole line of text'.format( + i.relname)): + pass \ No newline at end of file diff --git a/python/testSrc/com/jetbrains/python/PyFormatterTest.java b/python/testSrc/com/jetbrains/python/PyFormatterTest.java index 07af7e8f7ee3..815f61bd311f 100644 --- a/python/testSrc/com/jetbrains/python/PyFormatterTest.java +++ b/python/testSrc/com/jetbrains/python/PyFormatterTest.java @@ -299,7 +299,11 @@ public class PyFormatterTest extends PyTestCase { doTest(); } - public void testAlignInCallExpression() { + public void testAlignInCallExpression() { + doTest(); + } + + public void _testAlignInNestedCallInWith() { //PY-11337 TODO: doTest(); } @@ -310,8 +314,8 @@ public class PyFormatterTest extends PyTestCase { public void testIfConditionContinuation() { // PY-8195 doTest(); } - - public void _testIndentInNestedCall() { // PY-11906 TODO: fix indent + + public void _testIndentInNestedCall() { // PY-11919 TODO: required changes in formatter to be able to make indent relative to block or alignment doTest(); } @@ -381,7 +385,7 @@ public class PyFormatterTest extends PyTestCase { public void testIndentParensInImport() { // PY-9075 doTest(); } - + public void testAlignInParenthesizedExpression() { doTest(); }