summaryrefslogtreecommitdiffstats
path: root/test/vpp_papi_provider.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-25 12:47:04 -0800
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-25 12:47:04 -0800
commit00671cf9cfbcd9ed25d79712bf01d29cb8787bf2 (patch)
treed303607afac92b861515679af205725a31321cb1 /test/vpp_papi_provider.py
parent61e63bf4e14eddebdd99814cf2633c2e638cd21c (diff)
VPP-1508 python3 tests: python3 repr.
Use six.reprlib. Uses repr for python 2 and reprlib for python 3. Change-Id: Ia343a492d533bd511ed57166381e10a37e452d36 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/vpp_papi_provider.py')
-rw-r--r--test/vpp_papi_provider.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index f1e53177af2..eecf6e257e8 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1,9 +1,12 @@
-import os
import fnmatch
+import os
import time
-from hook import Hook
from collections import deque
+import six
+
+from hook import Hook
+
# Sphinx creates auto-generated documentation by importing the python source
# files and collecting the docstrings from them. The NO_VPP_PAPI flag allows
# the vpp_papi_provider.py file to be importable without having to build
@@ -184,14 +187,14 @@ class VppPapiProvider(object):
if hasattr(reply, 'retval') and reply.retval >= 0:
msg = "API call passed unexpectedly: expected negative "\
"return value instead of %d in %s" % \
- (reply.retval, repr(reply))
+ (reply.retval, six.reprlib(reply))
self.test_class.logger.info(msg)
raise UnexpectedApiReturnValueError(msg)
elif self._expect_api_retval == self._zero:
if hasattr(reply, 'retval') and reply.retval != expected_retval:
msg = "API call failed, expected %d return value instead "\
"of %d in %s" % (expected_retval, reply.retval,
- repr(reply))
+ six.reprlib(reply))
self.test_class.logger.info(msg)
raise UnexpectedApiReturnValueError(msg)
else: