mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-21 17:16:47 +03:00
pre-commit autoupdate (#9232)
This commit is contained in:
parent
f85d8cb81a
commit
74689b1f44
|
@ -1,6 +1,6 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.4.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
|
@ -9,17 +9,17 @@ repos:
|
|||
- id: check-symlinks
|
||||
- id: check-toml
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.12.0
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
- id: isort
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 3.9.0
|
||||
rev: 7.0.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies:
|
||||
- flake8-tidy-imports
|
||||
- repo: https://github.com/adamchainz/blacken-docs
|
||||
rev: 1.13.0
|
||||
rev: 1.16.0
|
||||
hooks:
|
||||
- id: blacken-docs
|
||||
exclude: ^(?!docs).*$
|
||||
|
|
|
@ -64,14 +64,10 @@ from rest_framework.schemas import get_schema_view
|
|||
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
|
||||
|
||||
schema_view = get_schema_view(
|
||||
title='Example API',
|
||||
renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
|
||||
title="Example API", renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path('swagger/', schema_view),
|
||||
...
|
||||
]
|
||||
urlpatterns = [path("swagger/", schema_view), ...]
|
||||
```
|
||||
|
||||
There have been a large number of fixes to the schema generation. These should
|
||||
|
|
|
@ -36,7 +36,7 @@ def api_view(http_method_names=None):
|
|||
# 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
|
||||
|
|
|
@ -192,7 +192,7 @@ class ThrottlingTests(TestCase):
|
|||
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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user