Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirement to pycodestyle 2.6.0 #548

Merged
merged 5 commits into from
May 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


INSTALL_REQUIRES = (
['pycodestyle == 2.5.0', 'toml']
['pycodestyle >= 2.6.0', 'toml']
)


Expand Down
3 changes: 2 additions & 1 deletion test/suite/out/E72.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#: E721
import types
if isinstance(res, type(42)):
pass
#: E721
if not isinstance(res, type("")):
pass
#: E721
import types

if res == types.IntType:
pass
#: E721
import types

if not isinstance(res, types.ListType):
pass
Expand Down
22 changes: 17 additions & 5 deletions test/test_autopep8.py
Original file line number Diff line number Diff line change
Expand Up @@ -3646,8 +3646,6 @@ def foobar(sldfkjlsdfsdf, kksdfsdfsf,sdfsdfsdf, sdfsdfkdk, szdfsdfsdf, sdfsdfsdf
pass
"""
fixed = """\


def foobar(
sldfkjlsdfsdf,
kksdfsdfsf,
Expand Down Expand Up @@ -5161,6 +5159,22 @@ def f(n):
with autopep8_context(line) as result:
self.assertEqual(result[:4], 'from')

@unittest.skipIf(
(sys.version_info.major >= 3 and sys.version_info.minor < 8)
or sys.version_info.major < 3,
"syntax error in Python3.7 and lower version",
)
def test_with_walrus_operator(self):
"""check pycodestyle 2.6.0+"""
line = """\
sql_stmt = ""
with open(filename) as f:
while line := f.readline():
sql_stmt += line
"""
with autopep8_context(line) as result:
self.assertEqual(line, result)


class UtilityFunctionTests(unittest.TestCase):

Expand Down Expand Up @@ -6286,7 +6300,7 @@ def _table_field_is_plain_widget(self, widget):
class Useless(object):

def _table_field_is_plain_widget(self, widget):
if widget.__class__ == Widget or(
if widget.__class__ == Widget or (
widget.__class__ == WidgetMeta and Widget in widget.__bases__):
return True

Expand Down Expand Up @@ -6681,8 +6695,6 @@ def test_e501_experimental_decorator(self):
@foo(('xxxxxxxxxxxxxxxxxxxxxxxxxx', users.xxxxxxxxxxxxxxxxxxxxxxxxxx), ('yyyyyyyyyyyy', users.yyyyyyyyyyyy), ('zzzzzzzzzzzzzz', users.zzzzzzzzzzzzzz))
"""
fixed = """\


@foo(('xxxxxxxxxxxxxxxxxxxxxxxxxx', users.xxxxxxxxxxxxxxxxxxxxxxxxxx),
('yyyyyyyyyyyy', users.yyyyyyyyyyyy),
('zzzzzzzzzzzzzz', users.zzzzzzzzzzzzzz))
Expand Down