Skip to content

Commit 715cb57

Browse files
committed
Merge remote-tracking branch 'origin/master' into edge
2 parents c883f4f + 5c74bc6 commit 715cb57

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/support.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ def write(self, message):
4545

4646

4747
class FakeLogger:
48+
"""An output capturing logger suitable for being passed to the
49+
majority of MiG code by presenting an API compatible interface
50+
with the common logger module.
51+
52+
An instance of this class is made avaiable to test cases which
53+
can pass it down into function calls and subsequenently make
54+
assertions against any output strings hat were recorded during
55+
execution while also avoiding noise hitting the console.
56+
"""
57+
4858
RE_UNCLOSEDFILE = re.compile(
4959
'unclosed file <.*? name=\'(?P<location>.*?)\'( .*?)?>')
5060

@@ -107,6 +117,15 @@ def identify_unclosed_file(specifics):
107117

108118

109119
class MigTestCase(TestCase):
120+
"""Embellished base class for MiG test cases. Provides additional commonly
121+
used assertions as well as some basics for the standardised and idiomatic
122+
testing of logic within the codebase.
123+
124+
By containing these details in a single place we can ensure the reliable
125+
cleanup of state across tests as well as permit enforcement of constraints
126+
on all code under test.
127+
"""
128+
110129
def __init__(self, *args):
111130
super(MigTestCase, self).__init__(*args)
112131
self._cleanup_paths = set()

0 commit comments

Comments
 (0)