Skip to content

Commit

Permalink
Merge from 3.x: PR #3931
Browse files Browse the repository at this point in the history
Closes #3700
Closes #3473
  • Loading branch information
ccordoba12 committed Jan 7, 2017
2 parents 1c9c199 + b0d4ee5 commit 1b72f52
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spyder/widgets/sourcecode/tests/test_autoindent.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ def test_keep_unindent_if_blank():
text = get_indent_fix(text)
assert text == " def f(x):\n return x\n\n", repr(text)

@pytest.mark.parametrize(
"text_input, expected, test_text",
[
("tags = ['(a)', '(b)', '(c)']\n", "tags = ['(a)', '(b)', '(c)']\n",
"test_commented_brackets"),
("s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n", "s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n",
"test_balanced_brackets"),
])
def test_indentation_with_spaces(text_input, expected, test_text):
text = get_indent_fix(text_input)
assert text == expected, test_text

# --- Failing tests
# -----------------------------------------------------------------------------
Expand All @@ -164,6 +175,10 @@ def test_def_with_unindented_comment():
("def function():\n", "def function():\n\t", "test simple def"),
("open_parenthesis(\n", "open_parenthesis(\n\t\t",
"open parenthesis"),
("tags = ['(a)', '(b)', '(c)']\n", "tags = ['(a)', '(b)', '(c)']\n",
"test_commented_brackets"),
("s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n", "s = a[(a['a'] == l) & (a['a'] == 1)]['a']\n",
"test_balanced_brackets"),
# Failing test
pytest.mark.xfail(
Expand Down

0 comments on commit 1b72f52

Please sign in to comment.