From de260fbe2214a98ad11b179d20f530f8818b87ca Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:12:09 +0100 Subject: [PATCH] MAINT: test types and rename test function --- tests/sympy/test_decorator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/sympy/test_decorator.py b/tests/sympy/test_decorator.py index 41a468e04..b9e4209a2 100644 --- a/tests/sympy/test_decorator.py +++ b/tests/sympy/test_decorator.py @@ -134,7 +134,7 @@ def evaluate(self) -> sp.Expr: assert y_expr.doit() == 5**3 -def test_unevaluated_expression_classvar_symbol(): +def test_unevaluated_expression_default_argument(): @unevaluated_expression class FunkyPower(sp.Expr): x: Any @@ -155,12 +155,20 @@ def evaluate(self) -> sp.Expr: assert exprs[0].doit() == x assert exprs[1].doit() == x**2 assert exprs[2].doit() == x**3 + for expr in exprs: + assert expr.x is x + assert isinstance(expr.m, sp.Integer) + assert expr.default_return is None half = sp.Rational(1, 2) FunkyPower.default_return = half assert exprs[0].doit() == half assert exprs[1].doit() == half assert exprs[2].doit() == half + for expr in exprs: + assert expr.x is x + assert isinstance(expr.m, sp.Integer) + assert expr.default_return is half def test_unevaluated_expression_callable():