summaryrefslogtreecommitdiff
path: root/tests/float
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-08-29 14:04:59 +1000
committerDamien George <damien@micropython.org>2020-08-29 14:12:20 +1000
commit0c7354afaf91da3dac2c5ec471603c9e7acc8eac (patch)
tree99bd5aa3c2d9160a257db591b96dd29717c61110 /tests/float
parent40d174ac7d1cc5c548756bb75b4f36b9b450b8bf (diff)
tests: Split out complex reverse-op tests to separate test file.
So they can be skipped if __rOP__'s are not supported on the target. Also fix the typo in the complex_special_methods.py filename. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/float')
-rw-r--r--tests/float/complex_reverse_op.py10
-rw-r--r--tests/float/complex_special_methods.py (renamed from tests/float/complex_special_mehods.py)5
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/float/complex_reverse_op.py b/tests/float/complex_reverse_op.py
new file mode 100644
index 000000000..a7351949d
--- /dev/null
+++ b/tests/float/complex_reverse_op.py
@@ -0,0 +1,10 @@
+# test complex interacting with special reverse methods
+
+
+class A:
+ def __radd__(self, x):
+ print("__radd__")
+ return 2
+
+
+print(1j + A())
diff --git a/tests/float/complex_special_mehods.py b/tests/float/complex_special_methods.py
index 6789013fa..7e54905e4 100644
--- a/tests/float/complex_special_mehods.py
+++ b/tests/float/complex_special_methods.py
@@ -6,10 +6,5 @@ class A:
print("__add__")
return 1
- def __radd__(self, x):
- print("__radd__")
- return 2
-
print(A() + 1j)
-print(1j + A())