From 365d4961d485df0fde081e6f05e75ab23b124ea9 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 13 Aug 2020 21:22:47 +0100 Subject: Remove print statements from Python tests Use exceptions instead of printing to stdout. Part of an effort to convert Python tests to python 3 syntax. --- Examples/test-suite/python/li_attribute_runme.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Examples/test-suite/python/li_attribute_runme.py') diff --git a/Examples/test-suite/python/li_attribute_runme.py b/Examples/test-suite/python/li_attribute_runme.py index 80e793618..764bcdb55 100644 --- a/Examples/test-suite/python/li_attribute_runme.py +++ b/Examples/test-suite/python/li_attribute_runme.py @@ -8,12 +8,10 @@ if aa.a != 1: raise RuntimeError aa.a = 3 if aa.a != 3: - print aa.a - raise RuntimeError + raise RuntimeError("aa.a: {}".format(aa.a)) if aa.b != 2: - print aa.b - raise RuntimeError + raise RuntimeError("aa.b: {}".format(aa.b)) aa.b = 5 if aa.b != 5: raise RuntimeError -- cgit v1.2.1 From d4ffa46f4168b85524ec26c07426fe97dfcb3a38 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 15 Aug 2020 00:16:04 +0100 Subject: Convert python tests using 2to3 These tests were converted using 2to3 and should be valid using Python 2.7 and Python 3+. --- Examples/test-suite/python/li_attribute_runme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Examples/test-suite/python/li_attribute_runme.py') diff --git a/Examples/test-suite/python/li_attribute_runme.py b/Examples/test-suite/python/li_attribute_runme.py index 764bcdb55..a5a6914cd 100644 --- a/Examples/test-suite/python/li_attribute_runme.py +++ b/Examples/test-suite/python/li_attribute_runme.py @@ -75,7 +75,7 @@ if myStringyClass.ReadOnlyString != "changed string": try: x = myFoo.does_not_exist raise RuntimeError -except AttributeError, e: +except AttributeError as e: if str(e).find("does_not_exist") == -1: raise RuntimeError -- cgit v1.2.1