File tree 2 files changed +3
-7
lines changed
2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from dataclasses import dataclass
4
4
from openapi_core .exceptions import OpenAPIError
5
- # from openapi_core.unmarshalling.schemas.exceptions import FormatUnmarshalError
5
+ from openapi_core .unmarshalling .schemas .exceptions import FormatUnmarshalError
6
6
from pyramid .httpexceptions import HTTPBadRequest
7
7
from pyramid .httpexceptions import HTTPInternalServerError
8
8
from pyramid .request import Request
@@ -49,17 +49,14 @@ def __str__(self) -> str:
49
49
50
50
51
51
@dataclass
52
- # class InvalidCustomFormatterValue(FormatUnmarshalError):
53
- # FIXME: `FormatUnmarshalError` is not available in `openapi-core` 0.19.0
54
- # See https://github.com/python-openapi/openapi-core/pull/562
55
- class InvalidCustomFormatterValue (Exception ):
52
+ class InvalidCustomFormatterValue (FormatUnmarshalError ):
56
53
"""Value failed to format with a custom formatter."""
57
54
58
55
field : str
59
56
60
57
def __str__ (self ) -> str :
61
58
"""Provide more control over error message."""
62
- return str (self .original_exception ) # type: ignore
59
+ return str (self .original_exception )
63
60
64
61
65
62
class ImproperAPISpecificationWarning (UserWarning ):
Original file line number Diff line number Diff line change @@ -556,7 +556,6 @@ def foo(*args: t.Any) -> Exception:
556
556
]
557
557
558
558
559
- @unittest .skip ("Needs to be re-implemented" )
560
559
class CustomFormattersTests (unittest .TestCase ):
561
560
"""A suite of tests that showcase how custom formatters can be used."""
562
561
You can’t perform that action at this time.
0 commit comments