()
| 814 | |
| 815 | #[test] |
| 816 | fn unary_arithmetic() { |
| 817 | let gil = Python::acquire_gil(); |
| 818 | let py = gil.python(); |
| 819 | |
| 820 | let c = UnaryArithmetic::create_instance(py).unwrap(); |
| 821 | py_run!(py, c, "assert -c == 'neg'"); |
| 822 | py_run!(py, c, "assert +c == 'pos'"); |
| 823 | py_run!(py, c, "assert abs(c) == 'abs'"); |
| 824 | py_run!(py, c, "assert ~c == 'invert'"); |
| 825 | } |
| 826 | |
| 827 | py_class!(class BinaryArithmetic |py| { |
| 828 | def __repr__(&self) -> PyResult<&'static str> { |