Opened 5 years ago

Closed 5 years ago

#16856 closed defect (invalid)

Doctest for src/sage/tests/cmdline.py

Reported by: mkamalakshya Owned by: mkamalakshya
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords:
Cc: tscrim, vbraun, knsam Merged in:
Authors: Reviewers: Kamalakshya Mahatab
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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.

Change History (7)

comment:1 Changed 5 years ago by tscrim

Did you try running make build from the sage root directory?

comment:2 Changed 5 years ago by mkamalakshya

Thanks. After doing "make build" all the doc tests passed.

comment:3 Changed 5 years ago by tscrim

  • Component changed from PLEASE CHANGE to build
  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Reviewers set to Travis Scrimshaw
  • Status changed from new to needs_review
  • Type changed from PLEASE CHANGE to defect

No problem. I sometimes wonder if there's a better way to advertise this...

comment:4 Changed 5 years ago by tscrim

  • Status changed from needs_review to positive_review

comment:5 Changed 5 years ago by tscrim

  • Authors Kamalakshya Mahatab deleted
  • Reviewers changed from Travis Scrimshaw to Kamalakshya Mahatab

comment:6 Changed 5 years ago by mkamalakshya

  • Cc knsam added

comment:7 Changed 5 years ago by vbraun

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.