One way that's pretty common is to do something like: result = whatever your testing solution = something you type in assert simplify(result - solution) == 0
This is better than constructing a special case form, because that form may change in the future. On Saturday, March 28, 2015 at 9:28:00 AM UTC-5, Joachim Durchholz wrote: > > I need to update a unit test where integrate now returns something that > contains 1/(2*(s+1)). > However, when I write that subexpression, SymPy gives me 1/(2*s + 2), > which compares unequal. > > What would be the best way forward? > Alternatives that I can think of: > - have integrate() do whatever SymPy does when constructing 1/(2*s + 2) > - have the unit test do it and leave integrate() as it is > - rewrite the unit test to directly construct the Expr object (how?) > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/cf30c58e-2fc2-4baa-b308-fa8335b41b3f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.