From 7dab8f1f127b73f162b68bbb6b4d7c329ec84d1a Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Fri, 27 May 2022 23:46:13 +0200 Subject: [PATCH] Tested extra error --- tests/modules/test_error_mngr.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/modules/test_error_mngr.py b/tests/modules/test_error_mngr.py index 62b32ab..75e7403 100644 --- a/tests/modules/test_error_mngr.py +++ b/tests/modules/test_error_mngr.py @@ -1,18 +1,19 @@ # Testing the error manager import logging +from collections import namedtuple from importlib import reload from unittest import TestCase import pytest import bootstraparse.modules.error_mngr as error_mngr -from bootstraparse.modules.error_mngr import ParsingError +from bootstraparse.modules.error_mngr import ParsingError, MismatchedContainerError all_logging_tests = [(i, j, k) for i in [None, "test.log"] for j in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL", "NOPE_PARAM"] for k in ["rich", None]] all_non_blocking_exception_tests = [ (ParsingError("test error", 10, 10, "testfile.bpr")), - (ParsingError()) - + (ParsingError()), + (MismatchedContainerError(namedtuple("Test", ["label", "line_number"])("test", 10),)), ] all_blocking_exception_tests = [ @@ -40,7 +41,7 @@ class TestLogging(TestCase): 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), 4) + self.assertGreaterEqual(len(captured.records), 3) for exception in all_blocking_exception_tests: with self.assertLogs() as captured: