#16856: Doctest for src/sage/tests/cmdline.py
-----------------------------+---------------------------------------
Reporter: mkamalakshya | Owner: mkamalakshya
Type: PLEASE CHANGE | Status: new
Priority: minor | Milestone: sage-6.4
Component: PLEASE CHANGE | Keywords:
Merged in: | Authors: Kamalakshya Mahatab
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+---------------------------------------
The doctest for cmdline.py fails. On executing the command
'$ sage -t src/sage/tests/cmdline.py' gives the following output
{{{
Running doctests with ID 2014-08-20-08-24-47-4a78a370.
Doctesting 2 files.
sage -t --warn-long 12.6 12.5
IOError in doctesting framework
**********************************************************************
Traceback (most recent call last):
File "/home/kamalakshya/sage/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 2121, in __call__
doctests, extras = self.source.create_doctests(sage_namespace)
File "/home/kamalakshya/sage/local/lib/python2.7/site-
packages/sage/doctest/sources.py", line 652, in create_doctests
raise IOError(errno.ENOENT, "File does not exist", self.path)
IOError: [Errno 2] File does not exist: '12.5'
sage -t --warn-long 12.6 src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 105, in
sage.tests.cmdline.test_executable
Failed example:
out.find(version()) >= 0
Expected:
True
Got:
False
**********************************************************************
File "src/sage/tests/cmdline.py", line 113, in
sage.tests.cmdline.test_executable
Failed example:
out.find(version()) >= 0
Expected:
True
Got:
False
**********************************************************************
File "src/sage/tests/cmdline.py", line 185, in
sage.tests.cmdline.test_executable
Failed example:
out.find(version()) >= 0
Expected:
True
Got:
False
**********************************************************************
1 item had failures:
3 of 210 in sage.tests.cmdline.test_executable
[209 tests, 3 failures, 23.05 s]
----------------------------------------------------------------------
}}}
to find out the error I executed the following command on sage and got
output as below:
{{{
from sage.tests.cmdline import test_executable
sage: version()
'Sage Version 6.4.beta0, Release Date: 2014-08-14'
sage: u=test_executable(["sage"])[0]
sage: u.find(version())
-1
}}}
The string for 'u' is:
{{{
sage: test_executable(["sage"])[0]
'\xe2\x94\x8c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x90\n\xe2\x94\x82
Sage Version 6.3, Release Date: 2014-08-10
\xe2\x94\x82\n\xe2\x94\x82 Type "notebook()" for the browser-based
notebook interface. \xe2\x94\x82\n\xe2\x94\x82 Type "help()" for
help.
\xe2\x94\x82\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x98\nsage:
\nExiting Sage (CPU time 0m0.01s, Wall time 0m0.01s).\n'
}}}
So the error is because 'Sage Version 6.4.beta0, Release Date: 2014-08-14'
is not a sub string of {{{test_executable(["sage"])[0]}}} and one need to
change 'Sage Version 6.3, Release Date: 2014-08-10' to 'Sage Version
6.4.beta0, Release Date: 2014-08-14'. I don't know whether other
characters in this string need change. Please fix it.
--
Ticket URL: <http://trac.sagemath.org/ticket/16856>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.