From ca051b75513274fb0757baf17a9c91611872dca4 Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Wed, 18 May 2022 04:19:14 +0200 Subject: [PATCH] Ajusted message len --- tests/modules/test_error_mngr.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/modules/test_error_mngr.py b/tests/modules/test_error_mngr.py index 51a72e4..62b32ab 100644 --- a/tests/modules/test_error_mngr.py +++ b/tests/modules/test_error_mngr.py @@ -34,31 +34,31 @@ class TestLogging(TestCase): with self.assertLogs() as captured: with pytest.raises(SystemExit): error_mngr.log_exception(Exception(''), level="CRITICAL") - self.assertEqual(len(captured.records), 2) + self.assertGreaterEqual(len(captured.records), 3) def test_log_exception_with_message(self): for exception in all_non_blocking_exception_tests: with self.assertLogs() as captured: error_mngr.log_exception(exception, level="Warning") - self.assertGreaterEqual(len(captured.records), 1) + self.assertGreaterEqual(len(captured.records), 4) for exception in all_blocking_exception_tests: with self.assertLogs() as captured: with pytest.raises(SystemExit): error_mngr.log_exception(exception, level="CRITICAL") - self.assertGreaterEqual(len(captured.records), 1) + self.assertGreaterEqual(len(captured.records), 4) def test_log_message(self): with self.assertLogs() as captured: error_mngr.log_message("test message", level="INFO") - self.assertEqual(1, len(captured.records)) + self.assertEqual(3, len(captured.records)) self.assertEqual("INFO", captured.records[0].levelname) self.assertEqual(" test message", captured.records[0].msg) def test_log_message_critical(self): with self.assertLogs() as captured: error_mngr.log_message("test message", level="CRITICAL") - self.assertEqual(len(captured.records), 1) + self.assertEqual(3, len(captured.records)) self.assertEqual("CRITICAL", captured.records[0].levelname) self.assertEqual(" test message", captured.records[0].msg)