mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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>
This commit is contained in:
10
tests/float/complex_reverse_op.py
Normal file
10
tests/float/complex_reverse_op.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# test complex interacting with special reverse methods
|
||||
|
||||
|
||||
class A:
|
||||
def __radd__(self, x):
|
||||
print("__radd__")
|
||||
return 2
|
||||
|
||||
|
||||
print(1j + A())
|
||||
@@ -6,10 +6,5 @@ class A:
|
||||
print("__add__")
|
||||
return 1
|
||||
|
||||
def __radd__(self, x):
|
||||
print("__radd__")
|
||||
return 2
|
||||
|
||||
|
||||
print(A() + 1j)
|
||||
print(1j + A())
|
||||
Reference in New Issue
Block a user