diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-05 00:03:43 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-05 00:03:43 +0100 |
commit | e5c4362a98cf31d909476d9f06825228f05a2c82 (patch) | |
tree | d6642e27a50fad6660a5705e900df86c6c25c1d7 /tests/basics/getitem.py | |
parent | 97abe22963af5b62656cef5a46c195215f75f7d2 (diff) | |
download | micropython-e5c4362a98cf31d909476d9f06825228f05a2c82.tar.gz micropython-e5c4362a98cf31d909476d9f06825228f05a2c82.zip |
tests: Add some more tests to improve code coverage of corner cases.
Diffstat (limited to 'tests/basics/getitem.py')
-rw-r--r-- | tests/basics/getitem.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/getitem.py b/tests/basics/getitem.py index f39296aca3..3029f83035 100644 --- a/tests/basics/getitem.py +++ b/tests/basics/getitem.py @@ -20,3 +20,13 @@ try: next(it) except StopIteration: pass + +# this class raises a non-StopIteration exception on iteration +class A: + def __getitem__(self, i): + raise TypeError +try: + for i in A(): + pass +except TypeError: + print("TypeError") |