diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2020-08-13 21:47:20 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2020-08-13 21:47:20 +0100 |
commit | 916955562870476171777b177562e6edc8c283d3 (patch) | |
tree | 4deae427beb6b309a4ac57621765344d60ef97d6 | |
parent | 64d3617b3c354dcaa243cc0a864ab729e75dbfab (diff) | |
download | swig-916955562870476171777b177562e6edc8c283d3.tar.gz |
Remove further print statements from Python tests
Use exceptions instead of printing to stdout.
Part of an effort to convert Python tests to python 3 syntax.
-rw-r--r-- | Examples/test-suite/python/default_constructor_runme.py | 18 | ||||
-rw-r--r-- | Examples/test-suite/python/smart_pointer_not_runme.py | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/Examples/test-suite/python/default_constructor_runme.py b/Examples/test-suite/python/default_constructor_runme.py index 301f422cf..2943dc960 100644 --- a/Examples/test-suite/python/default_constructor_runme.py +++ b/Examples/test-suite/python/default_constructor_runme.py @@ -16,7 +16,7 @@ dc.delete_AA(aa) try: b = dc.new_B() - print "Whoa. new_BB created." + raise RuntimeError("Whoa. new_BB created.") except TypeError: pass @@ -24,7 +24,7 @@ del_b = dc.delete_B try: bb = dc.new_BB() - print "Whoa. new_BB created." + raise RuntimeError("Whoa. new_BB created.") except AttributeError: pass @@ -32,7 +32,7 @@ del_bb = dc.delete_BB try: c = dc.new_C() - print "Whoa. new_C created." + raise RuntimeError("Whoa. new_C created.") except AttributeError: pass @@ -43,7 +43,7 @@ dc.delete_CC(cc) try: d = dc.new_D() - print "Whoa. new_D created" + raise RuntimeError("Whoa. new_D created") except AttributeError: pass @@ -51,7 +51,7 @@ del_d = dc.delete_D try: dd = dc.new_DD() - print "Whoa. new_DD created" + raise RuntimeError("Whoa. new_DD created") except AttributeError: pass @@ -59,7 +59,7 @@ dd = dc.delete_DD try: ad = dc.new_AD() - print "Whoa. new_AD created" + raise RuntimeError("Whoa. new_AD created") except AttributeError: pass @@ -73,7 +73,7 @@ dc.delete_EE(ee) try: eb = dc.new_EB() - print "Whoa. new_EB created" + raise RuntimeError("Whoa. new_EB created") except AttributeError: pass @@ -83,7 +83,7 @@ f = dc.new_F() try: del_f = dc.delete_F - print "Whoa. delete_F created" + raise RuntimeError("Whoa. delete_F created") except AttributeError: pass @@ -93,7 +93,7 @@ g = dc.new_G() try: del_g = dc.delete_G - print "Whoa. delete_G created" + raise RuntimeError("Whoa. delete_G created") except AttributeError: pass diff --git a/Examples/test-suite/python/smart_pointer_not_runme.py b/Examples/test-suite/python/smart_pointer_not_runme.py index 53006bce4..8cd9f11f3 100644 --- a/Examples/test-suite/python/smart_pointer_not_runme.py +++ b/Examples/test-suite/python/smart_pointer_not_runme.py @@ -7,36 +7,36 @@ g = Grok(f) try: x = b.x - print "Error! b.x" + raise RuntimeError("Error! b.x") except AttributeError: pass try: x = s.x - print "Error! s.x" + raise RuntimeError("Error! s.x") except AttributeError: pass try: x = g.x - print "Error! g.x" + raise RuntimeError("Error! g.x") except AttributeError: pass try: x = b.getx() - print "Error! b.getx()" + raise RuntimeError("Error! b.getx()") except AttributeError: pass try: x = s.getx() - print "Error! s.getx()" + raise RuntimeError("Error! s.getx()") except AttributeError: pass try: x = g.getx() - print "Error! g.getx()" + raise RuntimeError("Error! g.getx()") except AttributeError: pass |