diff options
author | Damien George <damien.p.george@gmail.com> | 2018-02-14 16:50:20 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-02-14 16:50:20 +1100 |
commit | 04c55f582866b700c5c39158ee76a1b970b71375 (patch) | |
tree | 2ba6bef5a0dc00f671d9c1959eb214890d5a80a2 /tests/basics/fun_error2.py | |
parent | 6031957473a15f62ecbe59b9d27e58e9d06a4d8a (diff) |
tests: Rewrite some tests so they can run without needing eval/exec.
For builds without the compiler enabled (and hence without eval/exec) it is
useful to still be able to run as many tests as possible.
Diffstat (limited to 'tests/basics/fun_error2.py')
-rw-r--r-- | tests/basics/fun_error2.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/basics/fun_error2.py b/tests/basics/fun_error2.py index 2a00396e6..39fd0af14 100644 --- a/tests/basics/fun_error2.py +++ b/tests/basics/fun_error2.py @@ -5,14 +5,8 @@ except: print("SKIP") raise SystemExit -def test_exc(code, exc): - try: - exec(code) - print("no exception") - except exc: - print("right exception") - except: - print("wrong exception") - # function with keyword args not given a specific keyword arg -test_exc("enumerate()", TypeError) +try: + enumerate() +except TypeError: + print('TypeError') |