Skip to content

Commit

Permalink
fix new mypy complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Dec 10, 2023
1 parent a8dcaf8 commit 8ecee1b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions drf_spectacular/plumbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,12 @@ class TmpView(views.APIView):
)
view.kwargs = {}
# prepare AutoSchema with "init" values as if get_operation() was called
view.schema.registry = registry
view.schema.path = path
view.schema.path_regex = path
view.schema.path_prefix = ''
view.schema.method = method.upper()
schema: Any = view.schema
schema.registry = registry
schema.path = path
schema.path_regex = path
schema.path_prefix = ''
schema.method = method.upper()
return view


Expand Down
2 changes: 1 addition & 1 deletion drf_spectacular/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SpectacularAPIView(APIView):
- YAML: application/vnd.oai.openapi
- JSON: application/vnd.oai.openapi+json
""")
""") # type: ignore
renderer_classes = [
OpenApiYamlRenderer, OpenApiYamlRenderer2, OpenApiJsonRenderer, OpenApiJsonRenderer2
]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extend_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class QuerySerializer(serializers.Serializer):
)
order_by = serializers.MultipleChoiceField(
choices=['a', 'b', 'c'],
default=['a'],
default=['a'], # type: ignore
)
tag = serializers.CharField(required=False)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get(self, request):


@api_view()
def x_view_function():
def x_view_function(request):
""" underspecified library view """
return Response(1.234) # pragma: no cover

Expand Down
2 changes: 1 addition & 1 deletion tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Meta:
class XViewset(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet):
__doc__ = _("""
More lengthy explanation of the view
""")
""") # type: ignore

serializer_class = XSerializer
queryset = I18nModel.objects.none()
Expand Down

0 comments on commit 8ecee1b

Please sign in to comment.