summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-18 08:17:34 -0800
committerFlorin Coras <florin.coras@gmail.com>2018-11-19 23:02:34 +0000
commitc7b03fe8f3fd2753d97ffdf8e7ebd85e2c527085 (patch)
tree25a70f6c45543a1197ecea0c733d659d5a128a99 /test
parent2dd192b76774beb9c7960527fb3f397a2848f679 (diff)
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 <pvinci@vinciconsulting.com>
Diffstat (limited to 'test')
-rw-r--r--test/framework.py3
1 files changed, 2 insertions, 1 deletions
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