Skip to content

Commit

Permalink
Trac #27794: py3: doctests in sets
Browse files Browse the repository at this point in the history
Fix the remaining py3 doctest failures in sets.

URL: https://trac.sagemath.org/27794
Reported by: jhpalmieri
Ticket author(s): John Palmieri
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed May 8, 2019
2 parents 8fa7e9c + bca7237 commit 595929f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/sage/sets/set_from_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,12 @@ def _element_constructor_(self, el):
TESTS::
sage: from sage.sets.set_from_iterator import EnumeratedSetFromIterator
sage: from six.moves import range
sage: S = EnumeratedSetFromIterator(range, args=(1,4))
sage: S(1) # indirect doctest
sage: S(1) # py2
1
sage: S(1) # py3
doctest:...: UserWarning: Testing equality of infinite sets which will not end in case of equality
1
sage: S(0) # indirect doctest
Traceback (most recent call last):
Expand Down Expand Up @@ -751,10 +754,14 @@ def __init__(self, inst, f, name=None, **options):
But not the enumerated set::
sage: loads(dumps(d.f()))
sage: loads(dumps(d.f())) # py2
Traceback (most recent call last):
...
PicklingError: Can't pickle <... 'function'>: attribute lookup __builtin__.function failed
sage: loads(dumps(d.f())) # py3
Traceback (most recent call last):
...
_pickle.PicklingError: Can't pickle <function DummyExampleForPicklingTest.f at ...>: it's not the same object as sage.sets.set_from_iterator.DummyExampleForPicklingTest.f
"""
self.inst = inst
self.f = f
Expand Down

0 comments on commit 595929f

Please sign in to comment.