diff --git a/rest_framework/schemas/inspectors.py b/rest_framework/schemas/inspectors.py index 135eb6e4e..aeb19d618 100644 --- a/rest_framework/schemas/inspectors.py +++ b/rest_framework/schemas/inspectors.py @@ -163,8 +163,10 @@ class ViewInspector(object): @property def view(self): """View property.""" - assert self._view is not None, "Schema generation REQUIRES a view instance. (Hint: you accessed `schema` from "\ - "the view class rather than an instance.) " + assert self._view is not None, ( + "Schema generation REQUIRES a view instance. (Hint: you accessed `schema` from " + "the view class rather than an instance.) " + ) return self._view @view.setter @@ -499,8 +501,9 @@ class DefaultSchema(ViewInspector): return result inspector_class = api_settings.DEFAULT_SCHEMA_CLASS - assert issubclass(inspector_class, ViewInspector), \ + assert issubclass(inspector_class, ViewInspector), ( "DEFAULT_SCHEMA_CLASS must be set to a ViewInspector (usually an AutoSchema) subclass" + ) inspector = inspector_class() inspector.view = instance return inspector