def test_kernel(): pytest.importorskip("pexpect") knl = MaximaKernel() knl.exec_str("k:1/(sqrt((x0-(a+t*b))^2+(y0-(c+t*d))^2+(z0-(e+t*f))^2))") knl.eval_str("sum(diff(k, t,deg)*t^deg,deg,0,6)") assert knl.eval_str("2+2").strip() == "4" knl.shutdown()
def _check_maxima(): global MAXIMA_UNAVAILABLE import os executable = os.environ.get("PYMBOLIC_MAXIMA_EXECUTABLE", "maxima") try: knl = MaximaKernel(executable=executable) MAXIMA_UNAVAILABLE = False knl.shutdown() except (ImportError, RuntimeError): MAXIMA_UNAVAILABLE = True
def test_restart(knl): pytest.importorskip("pexpect") knl = MaximaKernel() knl.restart() knl.eval_str("1") knl.shutdown()
def knl(request): knl = MaximaKernel() request.addfinalizer(knl.shutdown) return knl
def test_restart(knl): knl = MaximaKernel() knl.restart() knl.eval_str("1") knl.shutdown()
def knl(request): pytest.importorskip("pexpect") knl = MaximaKernel() request.addfinalizer(knl.shutdown) return knl