From c18b145d2df4a06912a01263e889d3bd0236312a Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Sun, 29 May 2022 21:58:04 +0200 Subject: [PATCH] Small error corrections --- src/bootstraparse/modules/context_mngr.py | 2 +- tests/modules/test_error_mngr.py | 6 +++--- tests/modules/test_syntax_context.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bootstraparse/modules/context_mngr.py b/src/bootstraparse/modules/context_mngr.py index 85a1915..a42c41f 100644 --- a/src/bootstraparse/modules/context_mngr.py +++ b/src/bootstraparse/modules/context_mngr.py @@ -435,7 +435,7 @@ if __name__ == "__main__": # pragma: no cover #. item 3 - item 4 - item 5 - + pog""" ) diff --git a/tests/modules/test_error_mngr.py b/tests/modules/test_error_mngr.py index 6d0fcb6..61f4e5a 100644 --- a/tests/modules/test_error_mngr.py +++ b/tests/modules/test_error_mngr.py @@ -41,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), 3) + self.assertGreaterEqual(len(captured.records), 1) for exception in all_blocking_exception_tests: with self.assertLogs() as captured: @@ -52,14 +52,14 @@ class TestLogging(TestCase): def test_log_message(self): with self.assertLogs() as captured: error_mngr.log_message("test message", level="INFO") - self.assertEqual(3, len(captured.records)) + self.assertEqual(len(captured.records), 1) 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(3, len(captured.records)) + self.assertGreaterEqual(len(captured.records), 1) self.assertEqual("CRITICAL", captured.records[0].levelname) self.assertEqual(" test message", captured.records[0].msg) diff --git a/tests/modules/test_syntax_context.py b/tests/modules/test_syntax_context.py index 4b296ef..b665948 100644 --- a/tests/modules/test_syntax_context.py +++ b/tests/modules/test_syntax_context.py @@ -20,8 +20,8 @@ _type_counterpart_container = [ (syntax.EtUnderlineToken, 'text:underline', "token", tools.__GLk(1)), (syntax.EtStrikethroughToken, 'text:strikethrough', "token", tools.__GLk(1)), (syntax.EtCustomSpanToken, None, "self", tools.__GLk(1), __XF), # Not sure what to do with custom spans - (syntax.EtUlistToken, None, "self", tools.__GLk(1), __XF), # Shouldn't be an error - (syntax.EtOlistToken, None, "self", tools.__GLk(1), __XF), # Shouldn't be an error + (syntax.EtUlistToken, None, "self", tools.__GLk(1)), + (syntax.EtOlistToken, None, "self", tools.__GLk(1)), (syntax.HeaderToken, None, "self", tools.__GLk(1)), (syntax.DisplayToken, None, "self", tools.__GLk(1)), (syntax.StructuralElementStartToken, None, "self", tools.__GLk(1)),