Print errors in test for confidence
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from contextlib import contextmanager
|
||||
from copy import deepcopy
|
||||
from typing import Any, Dict
|
||||
from unittest import TestCase
|
||||
@@ -54,6 +55,15 @@ class PydanticOIDCTestCase(TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.config = deepcopy(SAMPLE_CONFIG)
|
||||
|
||||
@contextmanager
|
||||
def assertRaises(self, *args, **kwargs):
|
||||
"""To demonstrate the example error messages generated by Pydantic, uncomment
|
||||
this method."""
|
||||
with super().assertRaises(*args, **kwargs) as result:
|
||||
yield result
|
||||
print()
|
||||
print(result.exception)
|
||||
|
||||
def test_example_config(self):
|
||||
# Check that parsing the sample config doesn't raise an error.
|
||||
OIDCProviderModel.parse_obj(self.config)
|
||||
|
||||
Reference in New Issue
Block a user