From c7b03fe8f3fd2753d97ffdf8e7ebd85e2c527085 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Sun, 18 Nov 2018 08:17:34 -0800 Subject: [PATCH] VPP-1498: test/framework.py: AttributeError Traceback if .send_keep_alive is called before pipe is configured. Traceback (most recent call last): File "/vpp/test/test_span.py", line 27, in setUpClass super(TestSpan, cls).setUpClass() File "/vpp/test/framework.py", line 411, in setUpClass cls.reporter.send_keep_alive(cls, 'setUpClass') File "/vpp/test/framework.py", line 172, in send_keep_alive if self.pipe is None: File "/vpp/test/framework.py", line 160, in pipe return self._pipe AttributeError: 'KeepAliveReporter' object has no attribute '_pipe' Change-Id: I561d2748441702478a84fbb4580a4d2667d70ffd Signed-off-by: Paul Vinciguerra --- test/framework.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/framework.py b/test/framework.py index 06876a1799b..4c536e062b0 100644 --- a/test/framework.py +++ b/test/framework.py @@ -151,6 +151,7 @@ class KeepAliveReporter(object): def __init__(self): self.__dict__ = self._shared_state + self._pipe = None @property def pipe(self): @@ -158,7 +159,7 @@ class KeepAliveReporter(object): @pipe.setter def pipe(self, pipe): - if hasattr(self, '_pipe'): + if self._pipe is not None: raise Exception("Internal error - pipe should only be set once.") self._pipe = pipe -- 2.16.6