On Mon, Jun 4, 2012 at 11:14 AM, Joachim Durchholz <[email protected]> wrote: > Am 04.06.2012 03:11, schrieb smichr: >> >> Perhaps the test runner could be patched to getstate before running >> mpmath and setstate afterwards? > > > I don't understand the details of the issue clearly enough to see all > ramifications, but I'd generally lean towards such a solution on the general > principle of "do not assume that called code is always correct".
Nor do I, but the general idea is that a current test can be influenced by results cached previously. By testing things in random order every time tests are run, we can help flush out such problems. But if the order is not different every time we run tests then this has defeated the whole point of random testing. And as it is now, mpmath is resetting the seed and thus all tests after it are always being run in the same order (unless some new tests have been added in the suite after mpmath). Also, for testing purposes: random(), for a given seed, will always return the same decimal number under current and future versions of python -- this is stated in the documentation. What is not constant, however, is the output of functions like randint, randrange, etc... so although random() might produce 0.123456 under 2.6 and 3.2, randint(1,100) might produce 23 under 2.6 and 42 under 3.2. This means that we have to put in ellipses in tests that use output that was generated randomly or skip the test -- which defeats the point of having the test. So I would like to see the changes that I've proposed for random in compatibility.py incorporated. /c -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
