def test_sympyissue_10773(): with evaluate(False): ans = Mul(Integer(-10), Pow(Integer(5), Integer(-1))) assert sympify('-10/5', evaluate=False) == ans with evaluate(False): ans = Mul(Integer(-10), Pow(Integer(-5), Integer(-1))) assert sympify('-10/-5', evaluate=False) == ans
def test_add(): with evaluate(False): expr = x + x assert isinstance(expr, Add) assert expr.args == (x, x) with evaluate(True): assert (x + x).args == (2, x) assert (x + x).args == (x, x) assert isinstance(x + x, Mul)
def test_nested(): with evaluate(False): expr = (x + x) + (y + y) assert expr.args == ((x + x), (y + y)) assert expr.args[0].args == (x, x)