devtools/testlib.py
changeset 10621 987fbc88f097
parent 10614 57dfde80df11
child 10651 9ca33768473c
--- a/devtools/testlib.py	Mon Sep 14 18:12:44 2015 +0200
+++ b/devtools/testlib.py	Mon Sep 14 18:10:20 2015 +0200
@@ -908,8 +908,11 @@
         view = viewsreg.select(vid, req, rset=rset, **kwargs)
         # set explicit test description
         if rset is not None:
+            # coerce to "bytes" on py2 because the description will be sent to
+            # sys.stdout/stderr which takes "bytes" on py2 and "unicode" on py3
+            rql = str(rset.printable_rql())
             self.set_description("testing vid=%s defined in %s with (%s)" % (
-                vid, view.__module__, rset.printable_rql()))
+                vid, view.__module__, rql))
         else:
             self.set_description("testing vid=%s defined in %s without rset" % (
                 vid, view.__module__))