On Sun, 9 Dec 2018 at 08:47, Ronny Pfannschmidt <opensou...@ronnypfannschmidt.de> wrote: > > As for the output variant, how does sympy decide which one to use, > does the issue happen when the `-s` flag of pytest is used.
Yes it does but actually this is a good point. The pprint function being used there is sympy's own pprint and the existing doctest runner has some code to modify its behaviour. That looks like it might be fixable within sympy then. I added from sympy.utilities.runtests import setup_pprint setup_pprint() to conftest.py and created a pytest.ini with [pytest] doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL and that's solved most of the failures. Is there any way to set those doctest option flags in conftest.py rather than pytest.ini? I am still getting a few errors like this from the repr though: ______________ [doctest] sympy.solvers.ode._undetermined_coefficients_match ... 5228 >>> _undetermined_coefficients_match(9*x*exp(x) + exp(-x), x) Expected: {'test': True, 'trialset': {x*exp(x), exp(-x), exp(x)}} Got: {'test': True, 'trialset': {exp(x), exp(-x), x*exp(x)}} This is somehow handled in sympy's test runner using sys.displayhook. If I can track that down in sympy it might be possible to solve these as well. > my off hand my suggestion would be to make a external pytest-doctest2 > plugin to experiment, once its solid i'd be more than happy to drop the > doctest plugin in the core of pytest (as it really only deals with > legacy ways of testing that are best migrated away from) That could be a good idea. Even if pytest didn't want to merge it sympy's test code could become a pytest plugin rather than its own reimplementation of pytest. I'll see how far I get with conftest.py first though... -- Oscar _______________________________________________ pytest-dev mailing list pytest-dev@python.org https://mail.python.org/mailman/listinfo/pytest-dev