Skip to content

Commit

Permalink
add test for w605 with multilines
Browse files Browse the repository at this point in the history
  • Loading branch information
hhatto committed Jun 1, 2020
1 parent b48d6a8 commit 1af4b85
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test_autopep8.py
Expand Up @@ -5066,6 +5066,20 @@ def test_w605_with_invalid_syntax(self):
with autopep8_context(line, options=['--aggressive']) as result:
self.assertEqual(fixed, result)

def test_w605_with_multilines(self):
line = r"""\
regex = '\d+(\.\d+){3}$'
foo = validators.RegexValidator(
regex='\d+(\.\d+){3}$')
"""
fixed = r"""\
regex = r'\d+(\.\d+){3}$'
foo = validators.RegexValidator(
regex=r'\d+(\.\d+){3}$')
"""
with autopep8_context(line, options=['--aggressive']) as result:
self.assertEqual(fixed, result)

def test_trailing_whitespace_in_multiline_string(self):
line = 'x = """ \nhello""" \n'
fixed = 'x = """ \nhello"""\n'
Expand Down

0 comments on commit 1af4b85

Please sign in to comment.