Make sets doctests ready for random seeds
Closed this issue · 12 comments
This ticket makes
sage -t --long --random-seed=n src/sage/sets/
pass for different values n than just 0.
Depends on #29962
Component: doctest framework
Author: Dave Morris
Branch/Commit: aae7813
Reviewer: Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/29973
At least the following needs to be fixed:
sage -t --long --random_seed=151058820726654196682836430928254760259 src/sage/sets/finite_enumerated_set.py # 1 doctest failed
Branch: public/29973
Author: Dave Morris
I added a # random tag to the example that failed in comment:1 (and also added a basic doctest S.random_element() in S to the random_element() method of FiniteEnumeratedSet ). I tried a few various seeds and have not seen any other doctest failures.
New commits:
aae7813 | trac 29973 random enumerated sets |
Commit: aae7813
After submitting the PR, I noticed that #29935 suggests S.random_element().parent() is S as a doctest, but I don't think that will work here:
sage: S = FiniteEnumeratedSet([1,2,3])
sage: a = S.random_element()
sage: a
2
sage: a.parent()
Integer Ring
sage: S.random_element().parent() is S
False
Thank you. I think it is fine.
Reviewer: Jonathan Kliem
I think it is important to implement fuzzing of the doctests, so I will try to look at some of the other tickets in #29935 too. Thanks very much for your extensive work on this project!! (and thank you for the review of this ticket)
Thanks.
Well there is #29954, which is pretty annoying and made me slow down a bit. This needs to be taken care of.
Changed branch from public/29973 to aae7813