diff options
| author | Damien George | 2016-10-17 11:43:47 +1100 |
|---|---|---|
| committer | Damien George | 2016-10-17 11:43:47 +1100 |
| commit | e9404e5f5f058db954ac0a92cb5acfcef6f6724a (patch) | |
| tree | 6d5ced599e860604aea660de5fb5be1199d29963 /tests/misc | |
| parent | 453c2e8f55132d92933f2de0308166730576ecc4 (diff) | |
tests: Improve coverage of array, range, dict, slice, exc, unicode.
Diffstat (limited to 'tests/misc')
| -rw-r--r-- | tests/misc/non_compliant.py | 18 | ||||
| -rw-r--r-- | tests/misc/non_compliant.py.exp | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index e0b07c3ad..677438b83 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -9,6 +9,12 @@ try: except SyntaxError: print('SyntaxError') +# store to exception attribute is not allowed +try: + ValueError().x = 0 +except AttributeError: + print('AttributeError') + # array deletion not implemented try: a = array.array('b', (1, 2, 3)) @@ -23,6 +29,12 @@ try: except NotImplementedError: print('NotImplementedError') +# containment, looking for integer not implemented +try: + print(1 in array.array('B', b'12')) +except NotImplementedError: + print('NotImplementedError') + # should raise type error try: print(set('12') >= '1') @@ -65,6 +77,12 @@ try: except NotImplementedError: print('NotImplementedError') +# str subscr with step!=1 not implemented +try: + print('abc'[1:2:3]) +except NotImplementedError: + print('NotImplementedError') + # bytes(...) with keywords not implemented try: bytes('abc', encoding='utf8') diff --git a/tests/misc/non_compliant.py.exp b/tests/misc/non_compliant.py.exp index 3095441ad..737650e9e 100644 --- a/tests/misc/non_compliant.py.exp +++ b/tests/misc/non_compliant.py.exp @@ -1,6 +1,8 @@ SyntaxError +AttributeError TypeError NotImplementedError +NotImplementedError True True TypeError, ValueError @@ -13,5 +15,6 @@ NotImplementedError NotImplementedError NotImplementedError NotImplementedError +NotImplementedError b'\x01\x02' b'\x01\x00' |
