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

CI failures: Pin prospector to 1.6.0, pytest to < 7.0.0, and fix linting issues with flake8 3.9.2 #18446

Merged
merged 7 commits into from
Feb 4, 2022
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
4 changes: 2 additions & 2 deletions build/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ yapf
pylint ; python_version > '2.7'
pycodestyle
pydocstyle
prospector ; python_version > '2.7'
pytest ; python_version > '2.7'
prospector>=1.6.0 ; python_version > '2.7'
pytest<7.0.0 ; python_version > '2.7'
flask
fastapi ; python_version > '2.7'
uvicorn ; python_version > '2.7'
Expand Down
49 changes: 24 additions & 25 deletions src/test/pythonFiles/linting/flake8config/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

__revision__ = None


class Foo(object):
"""block-disable test"""

Expand All @@ -10,78 +11,76 @@ def __init__(self):

def meth1(self, arg):
"""this issues a message"""
print self
print(self)

def meth2(self, arg):
"""and this one not"""
# pylint: disable=unused-argument
print self\
+ "foo"
print(self + "foo")

def meth3(self):
"""test one line disabling"""
# no error
print self.bla # pylint: disable=no-member
print(self.bla) # pylint: disable=no-member
# error
print self.blop
print(self.blop)

def meth4(self):
"""test re-enabling"""
# pylint: disable=no-member
# no error
print self.bla
print self.blop
print(self.bla)
print(self.blop)
# pylint: enable=no-member
# error
print self.blip
print(self.blip)

def meth5(self):
"""test IF sub-block re-enabling"""
# pylint: disable=no-member
# no error
print self.bla
print(self.bla)
if self.blop:
# pylint: enable=no-member
# error
print self.blip
print(self.blip)
else:
# no error
print self.blip
print(self.blip)
# no error
print self.blip
print(self.blip)

def meth6(self):
"""test TRY/EXCEPT sub-block re-enabling"""
# pylint: disable=no-member
# no error
print self.bla
print(self.bla)
try:
# pylint: enable=no-member
# error
print self.blip
except UndefinedName: # pylint: disable=undefined-variable
print(self.blip)
except UndefinedName: # pylint: disable=undefined-variable
# no error
print self.blip
print(self.blip)
# no error
print self.blip
print(self.blip)

def meth7(self):
"""test one line block opening disabling"""
if self.blop: # pylint: disable=no-member
if self.blop: # pylint: disable=no-member
# error
print self.blip
print(self.blip)
else:
# error
print self.blip
print(self.blip)
# error
print self.blip

print(self.blip)

def meth8(self):
"""test late disabling"""
# error
print self.blip
print(self.blip)
# pylint: disable=no-member
# no error
print self.bla
print self.blop
print(self.bla)
print(self.blop)