From b73ac3bcde86dc980cf6d9caad552d5c27cfbd71 Mon Sep 17 00:00:00 2001 From: CasVT Date: Tue, 4 Jul 2023 13:52:16 +0200 Subject: [PATCH] Fixed exceptions test after adding logging --- tests/custom_exceptions_test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/custom_exceptions_test.py b/tests/custom_exceptions_test.py index 66a97cb..88388da 100644 --- a/tests/custom_exceptions_test.py +++ b/tests/custom_exceptions_test.py @@ -7,9 +7,19 @@ import backend.custom_exceptions class Test_Custom_Exceptions(unittest.TestCase): def test_type(self): - defined_exceptions: List[Exception] = filter(lambda c: c.__module__ == 'backend.custom_exceptions', map(lambda c: c[1], getmembers(modules['backend.custom_exceptions'], isclass))) + defined_exceptions: List[Exception] = filter( + lambda c: c.__module__ == 'backend.custom_exceptions' and c is not backend.custom_exceptions.CustomException, + map( + lambda c: c[1], + getmembers(modules['backend.custom_exceptions'], isclass) + ) + ) + for defined_exception in defined_exceptions: - self.assertEqual(getmro(defined_exception)[1], Exception) + self.assertEqual( + getmro(defined_exception)[1], + backend.custom_exceptions.CustomException + ) result = defined_exception().api_response self.assertIsInstance(result, dict) result['error']