summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/main.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/unit/main.py b/test/unit/main.py
index 253ddc71..83aa9139 100644
--- a/test/unit/main.py
+++ b/test/unit/main.py
@@ -201,6 +201,8 @@ class TestUnit(unittest.TestCase):
self._print_log()
exit("Could not start unit")
+ self._started = True
+
self.skip_alerts = [
r'read signalfd\(4\) failed',
r'sendmsg.+failed',
@@ -209,7 +211,7 @@ class TestUnit(unittest.TestCase):
self.skip_sanitizer = False
def tearDown(self):
- stop_errs = self.stop()
+ self.stop()
# detect errors and failures for current test
@@ -244,18 +246,21 @@ class TestUnit(unittest.TestCase):
else:
self._print_log()
- self.assertListEqual(stop_errs, [None, None], 'stop errors')
+ self.assertListEqual(self.stop_errors, [None, None], 'stop errors')
def stop(self):
- errors = []
+ if not self._started:
+ return
+
+ self.stop_errors = []
- errors.append(self._stop())
+ self.stop_errors.append(self._stop())
- errors.append(self.stop_processes())
+ self.stop_errors.append(self.stop_processes())
atexit.unregister(self.stop)
- return errors
+ self._started = False
def _stop(self):
if self._p.poll() is not None: