From 0c7354afaf91da3dac2c5ec471603c9e7acc8eac Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 29 Aug 2020 14:04:59 +1000 Subject: 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 --- tests/float/complex_reverse_op.py | 10 ++++++++++ tests/float/complex_special_mehods.py | 15 --------------- tests/float/complex_special_methods.py | 10 ++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 tests/float/complex_reverse_op.py delete mode 100644 tests/float/complex_special_mehods.py create mode 100644 tests/float/complex_special_methods.py (limited to 'tests/float') 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_mehods.py deleted file mode 100644 index 6789013fa..000000000 --- a/tests/float/complex_special_mehods.py +++ /dev/null @@ -1,15 +0,0 @@ -# test complex interacting with special methods - - -class A: - def __add__(self, x): - print("__add__") - return 1 - - def __radd__(self, x): - print("__radd__") - return 2 - - -print(A() + 1j) -print(1j + A()) diff --git a/tests/float/complex_special_methods.py b/tests/float/complex_special_methods.py new file mode 100644 index 000000000..7e54905e4 --- /dev/null +++ b/tests/float/complex_special_methods.py @@ -0,0 +1,10 @@ +# test complex interacting with special methods + + +class A: + def __add__(self, x): + print("__add__") + return 1 + + +print(A() + 1j) -- cgit v1.2.3