#29973 closed enhancement (fixed)

Make sets doctests ready for random seeds

Reported by: gh-kliem Owned by:
Priority: major Milestone: sage-9.3
Component: doctest framework Keywords:
Cc: Merged in:
Authors: Dave Morris Reviewers: Jonathan Kliem
Report Upstream: N/A Work issues:
Branch: aae7813 (Commits, GitHub, GitLab) Commit: aae78139c7a229087872b014875ce9380f34bacf
Dependencies: #29962 Stopgaps:

Status badges


This ticket makes

sage -t --long --random-seed=n src/sage/sets/

pass for different values n than just 0.

Change History (9)

comment:1 Changed 18 months ago by gh-kliem

  • Dependencies set to #29962

At least the following needs to be fixed:

sage -t --long --random_seed=151058820726654196682836430928254760259 src/sage/sets/finite_enumerated_set.py  # 1 doctest failed

comment:2 Changed 15 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:3 Changed 12 months ago by gh-DaveWitteMorris

  • Branch set to public/29973

comment:4 Changed 12 months ago by gh-DaveWitteMorris

  • Authors set to Dave Morris
  • Commit set to aae78139c7a229087872b014875ce9380f34bacf
  • Status changed from new to needs_review

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:

aae7813trac 29973 random enumerated sets

comment:5 Changed 12 months ago by gh-DaveWitteMorris

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                                                                                  
sage: a.parent()                                                                         
Integer Ring
sage: S.random_element().parent() is S                                                   

comment:6 Changed 12 months ago by gh-kliem

  • Reviewers set to Jonathan Kliem
  • Status changed from needs_review to positive_review

Thank you. I think it is fine.

comment:7 Changed 12 months ago by gh-DaveWitteMorris

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)

comment:8 Changed 12 months ago by gh-kliem


Well there is #29954, which is pretty annoying and made me slow down a bit. This needs to be taken care of.

comment:9 Changed 11 months ago by vbraun

  • Branch changed from public/29973 to aae78139c7a229087872b014875ce9380f34bacf
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.