diff options
author | Damien George <damien.p.george@gmail.com> | 2014-09-24 14:14:38 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-09-25 15:49:26 +0100 |
commit | 2234c3f23d25de1d16adf73d585c8b8d070cb0b4 (patch) | |
tree | aaa3fb5ca02e79c99c0908be3e2a2c8d6a514cea /tests/basics/except_match_tuple.py | |
parent | 4bcd04bcaddeeb53779f2c067a4d1b533c888f9d (diff) | |
download | micropython-2234c3f23d25de1d16adf73d585c8b8d070cb0b4.tar.gz micropython-2234c3f23d25de1d16adf73d585c8b8d070cb0b4.zip |
tests: Add test for exception matching of a tuple of exceptions.
Diffstat (limited to 'tests/basics/except_match_tuple.py')
-rw-r--r-- | tests/basics/except_match_tuple.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/basics/except_match_tuple.py b/tests/basics/except_match_tuple.py new file mode 100644 index 0000000000..fea2f51c07 --- /dev/null +++ b/tests/basics/except_match_tuple.py @@ -0,0 +1,21 @@ +# test exception matching against a tuple + +try: + fail +except (Exception,): + print('except 1') + +try: + fail +except (Exception, Exception): + print('except 2') + +try: + fail +except (TypeError, NameError): + print('except 3') + +try: + fail +except (TypeError, ValueError, Exception): + print('except 4') |