Skip to content

Commit 55ba9cc

Browse files
committed
Do not make RunPostTestChecks inherit from TestCase
Aside from the coinciding setUp and tearDown names, it has nothing to do with a TestCase. Signed-off-by: mulhern <amulhern@redhat.com>
1 parent e462a89 commit 55ba9cc

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

stratis_cli_cert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def setUp(self):
185185
super().setUp()
186186

187187
self._post_test_checks = RunPostTestChecks()
188-
self._post_test_checks.setUp()
189188

190189
def tearDown(self):
191190
"""
@@ -195,7 +194,7 @@ def tearDown(self):
195194
"""
196195
super().tearDown()
197196

198-
self._post_test_checks.tearDown()
197+
self._post_test_checks.teardown()
199198

200199
def _test_permissions(self, command_line, permissions, exp_stdout_empty):
201200
"""

stratisd_cert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def setUp(self):
181181
super().setUp()
182182

183183
self._post_test_checks = RunPostTestChecks()
184-
self._post_test_checks.setUp()
185184

186185
def tearDown(self):
187186
"""
@@ -191,7 +190,7 @@ def tearDown(self):
191190
"""
192191
super().tearDown()
193192

194-
self._post_test_checks.tearDown()
193+
self._post_test_checks.teardown()
195194

196195
def _unittest_set_property(
197196
self, object_path, param_iface, dbus_param, dbus_value, exception_name

testlib/infra.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,16 +597,22 @@ def __str__(self):
597597
return self.value
598598

599599

600-
class RunPostTestChecks(unittest.TestCase):
600+
class RunPostTestChecks:
601601
"""
602602
Manage running post test checks
603603
"""
604604

605-
def setUp(self):
605+
def __init__(self):
606+
"""
607+
Set up checks that need to be started before test is run.
608+
"""
606609
self.dbus_monitor = DbusMonitor()
607610
self.dbus_monitor.setUp()
608611

609-
def tearDown(self):
612+
def teardown(self):
613+
"""
614+
Run post-test checks after test is completed.
615+
"""
610616
stop_time = time.monotonic_ns()
611617
self.dbus_monitor.run_check(stop_time)
612618

0 commit comments

Comments
 (0)