Skip to content

Commit 5e6cae0

Browse files
committed
Add flake8-bugbear
fix B009 Do not call getattr with a constant attribute value, it is not any safer than normal property access.
1 parent b59680c commit 5e6cae0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

testinfra/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class cached_property:
2020
""" # noqa
2121

2222
def __init__(self, func):
23-
self.__doc__ = getattr(func, '__doc__')
23+
self.__doc__ = func.__doc__
2424
self.func = func
2525

2626
def __get__(self, obj, cls):

tox.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ passenv=HOME TRAVIS DOCKER_CERT_PATH DOCKER_HOST DOCKER_TLS_VERIFY WSL_DISTRO_NA
1616

1717
[testenv:lint]
1818
description = Performs linting tasks
19-
deps=hacking
19+
deps=
20+
flake8
21+
hacking
22+
flake8-bugbear
2023
commands=flake8 {posargs}
2124

2225
[testenv:docs]

0 commit comments

Comments
 (0)