> I wanted to run some doctests with my Python 3 Sage installation.
> However, running "sage -t" results in
>
> Using --optional=dochtml,memlimit,mpir,python2,sage
>
> ie, python2 is in the list. Is that expected? How should I
> run the tests?
>
On a related note, I was attempting to test using the "external" flag (see
http://doc.sagemath.org/html/en/developer/doctesting.html#run-optional-doctests)
and ran across a number of errors possibly related to how this was
implemented. Random file that failed below.
(As some side notes, it didn't detect any external software for testing,
which seems odd since I certainly have internet and latex, probably also
imagemagick; also, the "optional - debug" command in this file crashed
Sage, and apparently in that file there is the line P._random_uniform_rec(2,
[1, 3, 4], (0,1), True, 2) which should be perhaps marked py3 since it
fails.)
The main point is that it is running precisely two tests - the ones marked
# py2 . Note these are not marked "optional - py2", just py2. I don't
know what the right way to run these doctests is, but anyway it's not
documented at http://doc.sagemath.org/html/en/developer/doctesting.html but
probably should be. I'm happy to open a ticket if someone can point me to
what the actual behavior should be; unfortunately this was the
closest-related message I could find on sage-devel. For now I'll try using
--optional=sage,python2,latex,internet as my arguments. Thanks for any
insight!
- kcrisman
$ ./sage -tp 3 --optional=external src/sage/rings/polynomial/pbori.pyx
too many failed tests, not using stored timings
Running doctests with ID 2019-03-14-09-49-33-56f7e373.
Git branch: develop
Using --optional=external
External software to be detected:
cplex,ffmpeg,graphviz,gurobi,imagemagick,internet,latex,macaulay2,magma,maple,mathematica,matlab,octave,pandoc,scilab
Doctesting 1 file using 3 threads.
sage -t src/sage/rings/polynomial/pbori.pyx
**********************************************************************
File "src/sage/rings/polynomial/pbori.pyx", line 1250, in
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_uniform_rec
Failed example:
P._random_uniform_rec(2, [1, 3, 4], (0,1), True, 2) # py2
Exception raised:
Traceback (most recent call last):
File
"/Users/karl.crisman/Downloads/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 671, in _run
self.compile_and_execute(example, compiler, test.globs)
File
"/Users/karl.crisman/Downloads/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 1095, in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_uniform_rec[0]>",
line 1, in <module>
P._random_uniform_rec(Integer(2), [Integer(1), Integer(3),
Integer(4)], (Integer(0),Integer(1)), True, Integer(2)) # py2
NameError: name 'P' is not defined
**********************************************************************
File "src/sage/rings/polynomial/pbori.pyx", line 1330, in
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_monomial_dfirst
Failed example:
[P._random_monomial_dfirst(3, (0,1,2)) for _ in range(10)] # py2
Exception raised:
Traceback (most recent call last):
File
"/Users/karl.crisman/Downloads/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 671, in _run
self.compile_and_execute(example, compiler, test.globs)
File
"/Users/karl.crisman/Downloads/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 1095, in compile_and_execute
exec(compiled, globs)
File "<doctest
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_monomial_dfirst[0]>",
line 1, in <module>
[P._random_monomial_dfirst(Integer(3),
(Integer(0),Integer(1),Integer(2))) for _ in range(Integer(10))] # py2
NameError: name 'P' is not defined
**********************************************************************
2 items had failures:
1 of 2 in
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_monomial_dfirst
1 of 2 in
sage.rings.polynomial.pbori.BooleanPolynomialRing._random_uniform_rec
[2 tests, 2 failures, 0.08 s]
----------------------------------------------------------------------
sage -t src/sage/rings/polynomial/pbori.pyx # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 1.1 seconds
cpu time: 0.1 seconds
cumulative wall time: 0.1 seconds
External software detected for doctesting:
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.