From b1950d5038e9328e077dd1d88e28c56e620d31d0 Mon Sep 17 00:00:00 2001 From: Jotham Apaloo Date: Mon, 19 Feb 2018 14:08:49 -0800 Subject: [PATCH] Fix logs buffer clearing and clear it before each test --- tests/mockLogzioListener/listener.py | 2 +- tests/test_logzioSender.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/mockLogzioListener/listener.py b/tests/mockLogzioListener/listener.py index df97218..213756f 100644 --- a/tests/mockLogzioListener/listener.py +++ b/tests/mockLogzioListener/listener.py @@ -73,7 +73,7 @@ class MockLogzioListener: return len(self.logs_list) def clear_logs_buffer(self): - self.logs_list = [] + self.logs_list[:] = [] def set_server_error(self): self.persistent_flags.set_server_error() diff --git a/tests/test_logzioSender.py b/tests/test_logzioSender.py index 9556e7f..420688b 100644 --- a/tests/test_logzioSender.py +++ b/tests/test_logzioSender.py @@ -21,6 +21,7 @@ def _find(pattern, path): class TestLogzioSender(TestCase): def setUp(self): self.logzio_listener = listener.MockLogzioListener() + self.logzio_listener.clear_logs_buffer() self.logzio_listener.clear_server_error() self.logs_drain_timeout = 1