#8834: make R png graphics doctests optional
----------------------------+-----------------------------------------------
Reporter: was | Owner: jason, was
Type: defect | Status: closed
Priority: blocker | Milestone: sage-4.4.2
Component: graphics | Resolution: fixed
Keywords: | Author: William Stein
Upstream: N/A | Reviewer: Minh Van Nguyen
Merged: sage-4.4.1.rc0 | Work_issues:
----------------------------+-----------------------------------------------
Changes (by newvalueoldvalue):
* status: needs_review => closed
* reviewer: => Minh Van Nguyen
* resolution: => fixed
* merged: 4.4.1.rc0 => sage-4.4.1.rc0
* author: => William Stein
Comment:
Doctests pass on bsd.math (Mac OS X 10.6) with the option:
{{{
[mv...@bsd sage-4.4.1.rc0]$ ./sage -t -long devel/sage-
main/sage/interfaces/r.py
}}}
But doctests would fail with:
{{{
sage -t -long --only_optional=rgraphics "devel/sage-
main/sage/interfaces/r.py"
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 338:
sage: r.png(filename='"%s"'%filename) # optional --
rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[3]>", line 1, in <module>
r.png(filename='"%s"'%filename) # optional --
rgraphics###line 338:
sage: r.png(filename='"%s"'%filename) # optional --
rgraphics
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/lib/python/site-
packages/sage/interfaces/r.py", line 359, in png
raise RuntimeError, "R was not compiled with PNG support"
RuntimeError: R was not compiled with PNG support
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 342:
sage: r.plot(x,y) # This saves to filename, but is not viewable from
command line; optional -- rgraphics
Expected:
null device
1
Got:
Error: object 'sage8' not found
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 345:
sage: import os; os.unlink(filename) # We remove the file for
doctesting; optional -- rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_0[7]>", line 1, in <module>
import os; os.unlink(filename) # We remove the file for
doctesting; optional -- rgraphics###line 345:
sage: import os; os.unlink(filename) # We remove the file for
doctesting; optional -- rgraphics
OSError: [Errno 2] No such file or directory:
'/Users/mvngu/.sage//temp/bsd.local/96132//tmp_0.png'
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 352:
sage: "TRUE" in s+t # optional -- rgraphics
Expected:
True
Got:
False
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 961:
sage: r.plot("1:10") # optional -- rgraphics
Expected:
null device
1
Got:
[1] 4
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 970:
sage: r.png(filename='"%s"'%filename) # Note the double quotes in
single quotes!; optional -- rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_1[5]>", line 1, in <module>
r.png(filename='"%s"'%filename) # Note the double quotes in single
quotes!; optional -- rgraphics###line 970:
sage: r.png(filename='"%s"'%filename) # Note the double quotes in
single quotes!; optional -- rgraphics
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/lib/python/site-
packages/sage/interfaces/r.py", line 359, in png
raise RuntimeError, "R was not compiled with PNG support"
RuntimeError: R was not compiled with PNG support
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 974:
sage: r.plot(x,y) # optional -- rgraphics
Expected:
null device
1
Got:
Error: object 'sage10' not found
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 977:
sage: import os; os.unlink(filename) # For doctesting, we remove the
file; optional -- rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_1[9]>", line 1, in <module>
import os; os.unlink(filename) # For doctesting, we remove the
file; optional -- rgraphics###line 977:
sage: import os; os.unlink(filename) # For doctesting, we remove the
file; optional -- rgraphics
OSError: [Errno 2] No such file or directory:
'/Users/mvngu/.sage//temp/bsd.local/96132//tmp_1.png'
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 997:
sage: r.png(filename='"%s"'%filename) # filename not needed in
notebook, used for doctesting; optional -- rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_1[11]>", line 1, in <module>
r.png(filename='"%s"'%filename) # filename not needed in notebook,
used for doctesting; optional -- rgraphics###line 997:
sage: r.png(filename='"%s"'%filename) # filename not needed in
notebook, used for doctesting; optional -- rgraphics
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/lib/python/site-
packages/sage/interfaces/r.py", line 359, in png
raise RuntimeError, "R was not compiled with PNG support"
RuntimeError: R was not compiled with PNG support
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 1000:
sage: r("print(histogram(~wt | cyl, data=mtcars))") # plot should
appear; optional -- rgraphics
Expected nothing
Got:
[1] 4
**********************************************************************
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/devel/sage-
main/sage/interfaces/r.py", line 1001:
sage: import os; os.unlink(filename) # We remove the file for
doctesting, not needed in notebook; optional -- rgraphics
Exception raised:
Traceback (most recent call last):
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/Users/mvngu/sandbox/sage-4.4.1.rc0/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_1[14]>", line 1, in <module>
import os; os.unlink(filename) # We remove the file for
doctesting, not needed in notebook; optional -- rgraphics###line 1001:
sage: import os; os.unlink(filename) # We remove the file for
doctesting, not needed in notebook; optional -- rgraphics
OSError: [Errno 2] No such file or directory:
'/Users/mvngu/.sage//temp/bsd.local/96132//tmp_2.png'
**********************************************************************
2 items had failures:
4 of 11 in __main__.example_0
7 of 15 in __main__.example_1
***Test Failed*** 11 failures.
For whitespace errors, see the file /Users/mvngu/.sage//tmp/.doctest_r.py
[3.0 s]
----------------------------------------------------------------------
The following tests failed:
sage -t -long --only_optional=rgraphics "devel/sage-
main/sage/interfaces/r.py"
Total time for all tests: 3.0 seconds
}}}
Making the specified doctests optional mean we're postponing a fix for the
failure for a later time. Note that the above doctest failure is specific
to Mac OS X as far as I can tell.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8834#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en.