summaryrefslogtreecommitdiffstats
path: root/gitlint/tests/base.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-10-13 05:34:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-10-13 05:34:54 +0000
commitb8d423e7d13686d6627571d6c4adf12661d82147 (patch)
tree11d64ff26fb53c3c01ee35d062ca0c51fb883550 /gitlint/tests/base.py
parentAdding upstream version 0.15.1. (diff)
downloadgitlint-b8d423e7d13686d6627571d6c4adf12661d82147.tar.xz
gitlint-b8d423e7d13686d6627571d6c4adf12661d82147.zip
Adding upstream version 0.16.0.upstream/0.16.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/tests/base.py')
-rw-r--r--gitlint/tests/base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gitlint/tests/base.py b/gitlint/tests/base.py
index 9406240..017122b 100644
--- a/gitlint/tests/base.py
+++ b/gitlint/tests/base.py
@@ -126,6 +126,10 @@ class BaseTestCase(unittest.TestCase):
"""
return super().assertRaisesRegex(expected_exception, re.escape(expected_regex), *args, **kwargs)
+ def clearlog(self):
+ """ Clears the log capture """
+ self.logcapture.clear()
+
@contextlib.contextmanager
def assertRaisesMessage(self, expected_exception, expected_msg): # pylint: disable=invalid-name
""" Asserts an exception has occurred with a given error message """
@@ -182,3 +186,6 @@ class LogCapture(logging.Handler):
def emit(self, record):
self.messages.append(self.format(record))
+
+ def clear(self):
+ self.messages = []