diff options
author | Damien George <damien.p.george@gmail.com> | 2017-12-14 12:25:30 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-12-14 12:25:30 +1100 |
commit | 36f79523abe8d79fec1cc7af41e8e96e8ceb2cc4 (patch) | |
tree | a0dff868ffdc95cd973c46e5a1fa9b79aecd00a0 /tests/misc/non_compliant.py | |
parent | badaf3ecfe5d0c8158debf4bd0cb1458016c77f4 (diff) | |
download | micropython-36f79523abe8d79fec1cc7af41e8e96e8ceb2cc4.tar.gz micropython-36f79523abe8d79fec1cc7af41e8e96e8ceb2cc4.zip |
tests: Add tests to improve coverage of py/objtype.c.
Diffstat (limited to 'tests/misc/non_compliant.py')
-rw-r--r-- | tests/misc/non_compliant.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index 152633c3b7..31129f0759 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -124,3 +124,18 @@ try: f.x = 1 except AttributeError: print('AttributeError') + +# can't call a function type (ie make new instances of a function) +try: + type(f)() +except TypeError: + print('TypeError') + +# test when object explicitly listed at not-last position in parent tuple +# this is not compliant with CPython because of illegal MRO +class A: + def foo(self): + print('A.foo') +class B(object, A): + pass +B().foo() |