summaryrefslogtreecommitdiff
path: root/tests/basics/class_getattr.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-10-18 12:28:09 +1100
committerDamien George <damien.p.george@gmail.com>2018-10-18 12:28:09 +1100
commita07e56cbd8adfaa9f3f456ec0173e40c647fbb05 (patch)
tree53f9ed95dd4aa0e65cb1e40651af039ed9e38da6 /tests/basics/class_getattr.py
parent7eb29c200077096a4c6afc2679b35d70068de89d (diff)
tests/basics/class_getattr: Remove invalid test for __getattribute__.
Part of this test was trying to test some functionality of __getattribute__ but this method name was misspelt so it wasn't doing anything useful. Fixing the typo in this name makes the test fail because MicroPython doesn't support user defined __getattribute__ methods. So this part of the test is removed. The remaining tests are modified slightly to make it clearer what they are testing.
Diffstat (limited to 'tests/basics/class_getattr.py')
-rw-r--r--tests/basics/class_getattr.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/basics/class_getattr.py b/tests/basics/class_getattr.py
index 1f875ce53..eadf2b209 100644
--- a/tests/basics/class_getattr.py
+++ b/tests/basics/class_getattr.py
@@ -1,4 +1,4 @@
-# test that __getattr__, __getattrribute__ and instance members don't override builtins
+# test that __getattr__ and instance members don't override builtins
class C:
def __init__(self):
self.__add__ = lambda: print('member __add__')
@@ -7,10 +7,8 @@ class C:
def __getattr__(self, attr):
print('__getattr__', attr)
return None
- def __getattrribute__(self, attr):
- print('__getattrribute__', attr)
- return None
c = C()
-c.__add__
-c + 1 # should call __add__
+c.add # should call __getattr__
+c.__add__() # should load __add__ instance directly
+c + 1 # should call __add__ method directly