From c8d7dde456954ecaa432f528ae84f6f360f88bcf Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 29 Feb 2024 16:07:31 +0900 Subject: [PATCH] make test coverage 100% (#203) Signed-off-by: Inada Naoki --- .coveragerc | 4 +++- tests/test_sender.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 3d5fc07..2692cb7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,9 @@ [run] branch = True -omit = */tests/* +omit = + */tests/* + fluent/__about__.py [report] omit = */tests/* diff --git a/tests/test_sender.py b/tests/test_sender.py index e2c5710..d915e98 100644 --- a/tests/test_sender.py +++ b/tests/test_sender.py @@ -142,6 +142,12 @@ def test_emit_error(self): self.assertEqual(len(data), 1) self.assertEqual(data[0][2]["message"], "Can't output to log") + def test_emit_error_no_forward(self): + with self._sender as sender: + sender.forward_packet_error = False + with self.assertRaises(TypeError): + sender.emit("blah", {"a": object()}) + def test_emit_after_close(self): with self._sender as sender: self.assertTrue(sender.emit("blah", {"a": "123"}))