From c096c2b981877730e8d3a298eb46c274f1659755 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Tue, 31 Dec 2013 14:24:23 -0800 Subject: [PATCH] python 3 compatibility (#13) --- rospy_tutorials/test/test_add_two_ints.py | 3 ++- rospy_tutorials/test/test_on_shutdown.py | 2 +- rospy_tutorials/test/test_peer_subscribe_notify.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rospy_tutorials/test/test_add_two_ints.py b/rospy_tutorials/test/test_add_two_ints.py index 00a4ecba..efd81faf 100755 --- a/rospy_tutorials/test/test_add_two_ints.py +++ b/rospy_tutorials/test/test_add_two_ints.py @@ -35,6 +35,8 @@ ## Integration test for add_two_ints +from __future__ import print_function + PKG = 'rospy_tutorials' NAME = 'add_two_ints_test' @@ -45,7 +47,6 @@ import rostest from rospy_tutorials.srv import * - class TestAddTwoInts(unittest.TestCase): def test_add_two_ints(self): diff --git a/rospy_tutorials/test/test_on_shutdown.py b/rospy_tutorials/test/test_on_shutdown.py index 992395f8..3fcf5c1e 100755 --- a/rospy_tutorials/test/test_on_shutdown.py +++ b/rospy_tutorials/test/test_on_shutdown.py @@ -55,7 +55,7 @@ def __init__(self, *args): self.success = False def callback(self, data): - print(rospy.get_caller_id(), "I heard %s"%data.data_) + print(rospy.get_caller_id(), "I heard %s" % data.data) #greetings is only sent over peer_publish callback, so hearing it is a success condition if "I'm dead" in data.data: self.success = True diff --git a/rospy_tutorials/test/test_peer_subscribe_notify.py b/rospy_tutorials/test/test_peer_subscribe_notify.py index e32147c6..f176c100 100755 --- a/rospy_tutorials/test/test_peer_subscribe_notify.py +++ b/rospy_tutorials/test/test_peer_subscribe_notify.py @@ -56,7 +56,7 @@ def __init__(self, *args): self.success = False def callback(self, data): - print(rospy.get_caller_id(), "I heard %s" % data.data_) + print(rospy.get_caller_id(), "I heard %s" % data.data) #greetings is only sent over peer_publish callback, so hearing it is a success condition if data.data.startswith('greetings'): self.success = True