diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64ec37770f..8bb131a047 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: hooks: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 3.9.0 + rev: 5.0.0 hooks: - id: flake8 additional_dependencies: diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 3b572c09ef..6194817563 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -36,7 +36,7 @@ def decorator(func): # WrappedAPIView.__doc__ = func.doc <--- Not possible to do this # api_view applied without (method_names) - assert not(isinstance(http_method_names, types.FunctionType)), \ + assert not (isinstance(http_method_names, types.FunctionType)), \ '@api_view missing list of allowed HTTP methods' # api_view applied with eg. string instead of list of strings diff --git a/tests/test_throttling.py b/tests/test_throttling.py index d5a61232d9..be9decebc5 100644 --- a/tests/test_throttling.py +++ b/tests/test_throttling.py @@ -192,7 +192,7 @@ def ensure_response_header_contains_proper_throttle_field(self, view, expected_h if expect is not None: assert response['Retry-After'] == expect else: - assert not'Retry-After' in response + assert 'Retry-After' not in response def test_seconds_fields(self): """