Skip to content

Commit

Permalink
Merge pull request #729 from hhatto/add-unit-test-for-e501-with-async…
Browse files Browse the repository at this point in the history
…-def

add: unit test for e501 with async def
  • Loading branch information
hhatto authored Mar 14, 2024
2 parents e4f02ec + e58f6b1 commit 06616d3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/test_autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -3709,6 +3709,19 @@ def foo(sldfkjlsdfsdf, kksdfsdfsf, sdfsdfsdf, sdfsdfkdk, szdfsdfsdf,
with autopep8_context(line, options=['--aggressive']) as result:
self.assertEqual(fixed, result)

def test_e501_aggressive_with_async_def(self):
line = """\
async def foo(sldfkjlsdfsdf, kksdfsdfsf,sdfsdfsdf, sdfsdfkdk, szdfsdfsdf, sdfsdfsdfsdlkfjsdlf, sdfsdfddf,sdfsdfsfd, sdfsdfdsf):
pass
"""
fixed = """\
async def foo(sldfkjlsdfsdf, kksdfsdfsf, sdfsdfsdf, sdfsdfkdk,
szdfsdfsdf, sdfsdfsdfsdlkfjsdlf, sdfsdfddf, sdfsdfsfd, sdfsdfdsf):
pass
"""
with autopep8_context(line, options=['--aggressive']) as result:
self.assertEqual(fixed, result)

def test_e501_more_aggressive_with_def(self):
line = """\
def foobar(sldfkjlsdfsdf, kksdfsdfsf,sdfsdfsdf, sdfsdfkdk, szdfsdfsdf, sdfsdfsdfsdlkfjsdlf, sdfsdfddf,sdfsdfsfd, sdfsdfdsf):
Expand All @@ -3730,6 +3743,27 @@ def foobar(
with autopep8_context(line, options=['-aa']) as result:
self.assertEqual(fixed, result)

def test_e501_more_aggressive_with_async_def(self):
line = """\
async def foobar(sldfkjlsdfsdf, kksdfsdfsf,sdfsdfsdf, sdfsdfkdk, szdfsdfsdf, sdfsdfsdfsdlkfjsdlf, sdfsdfddf,sdfsdfsfd, sdfsdfdsf):
pass
"""
fixed = """\
async def foobar(
sldfkjlsdfsdf,
kksdfsdfsf,
sdfsdfsdf,
sdfsdfkdk,
szdfsdfsdf,
sdfsdfsdfsdlkfjsdlf,
sdfsdfddf,
sdfsdfsfd,
sdfsdfdsf):
pass
"""
with autopep8_context(line, options=['-aa']) as result:
self.assertEqual(fixed, result)

def test_e501_aggressive_with_tuple(self):
line = """\
def f():
Expand Down

0 comments on commit 06616d3

Please sign in to comment.