summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/config/test_oidc2.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/config/test_oidc2.py b/tests/config/test_oidc2.py
index 3bff60214c..e5a9da68a7 100644
--- a/tests/config/test_oidc2.py
+++ b/tests/config/test_oidc2.py
@@ -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)