Opened 12 years ago

Closed 12 years ago

Last modified 6 years ago

#6646 closed defect (duplicate)

R doctest failed

Reported by: adavid Owned by: was
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: interfaces Keywords: doctest
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by chapoton)

sage -t  "devel/sage/sage/interfaces/"                  
File "/home/anthonyd/sage-4.1.1.alpha0/devel/sage/sage/interfaces/", line 83
    sage: r.completions('tes')
    ['testPlatformEquivalence', 'testVirtual']
    Building R command completion list (this takes
    a few seconds only the first time you do it).
    To force rebuild later, delete /home/anthonyd/.sage//r_commandlist.sobj.
    ['testPlatformEquivalence', 'testVirtual']
1 items had failures:
   1 of   3 in __main__.example_34
***Test Failed*** 1 failures.
For whitespace errors, see the file /home/anthonyd/sage-4.1.1.alpha0/tmp/

cat /home/anthonyd/sage-4.1.1.alpha0/tmp/
sage -t  "devel/sage/sage/interfaces/" 
# -*- coding: utf-8 -*-
from sage.all_cmdline import *; 
import sage.plot.plot; sage.plot.plot.DOCTEST_MODE=True

def warning_function(f):
    import warnings

    def doctest_showwarning(message, category, filename, lineno, file=f, line=None):
            file.write(warnings.formatwarning(message, category, 'doctest', lineno, line))
        except IOError:
            pass # the file (probably stdout) is invalid
    return doctest_showwarning

def change_warning_output(file):
    import warnings
    warnings.showwarning = warning_function(file)
def example_0():    r""">>> set_random_seed(0L)

>>> change_warning_output(sys.stdout)

   T-Test using R

      x, y -- vectors of same length
      conf_level -- confidence level of the interval, [0,1) in percent

      Tuple: (p-value, R return object)

      >>> a, b = ttest([Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)],[Integer(1),Integer(2),Integer(3),RealNumber('3.5'),RealNumber('5.121')]); a###line 30:_sage_    >>> a, b = ttest([1,2,3,4,5],[1,2,3,3.5,5.121]); a

if __name__ ==  '__main__':
    verbose = False
    do_timeit = False
    output_filename = '/home/anthonyd/sage-4.1.1.alpha0/devel/sage/sage/stats/'

    import sys
    sys.path = sys.path + ['/home/anthonyd/sage-4.1.1.alpha0/local/bin']
    import sagedoctest

    # execfile('/home/anthonyd/sage-4.1.1.alpha0/devel/sage/sage/stats/')
    m = sys.modules[__name__]
    m.__file__ = '/home/anthonyd/sage-4.1.1.alpha0/devel/sage/sage/stats/'

    # configure special sage doc test runner
    runner = sagedoctest.SageDocTestRunner(checker=None, verbose=verbose, optionflags=0)
    runner._collect_timeit_stats = do_timeit
    runner._reset_random_seed = True

    runner = sagedoctest.testmod_returning_runner(m,
                   # filename='/home/anthonyd/sage-4.1.1.alpha0/devel/sage/sage/stats/',

Change History (4)

comment:1 Changed 12 years ago by GeorgSWeber

That looks like #6594, fixed in Sage-4.1.1.alpha1.

The paths displayed in the output above indicate that Sage-4.1.1.alpha0 was tested, where the bug definitely occured.

So IMHO this ticket can safely be closed as a dupe.

Cheers, Georg

comment:2 Changed 12 years ago by mvngu

The path name looks like it's Sage 4.1.1.alpha0. But it may be that adavid upgraded to Sage 4.1.1.alpha1 with that version and then ran doctests. One way to make sure is for adavid to have a look at the patch for #6594 and compare that with the file sage/interfaces/ in the version he doctested.

comment:3 Changed 12 years ago by mvngu

  • Milestone changed from sage-4.1.1 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #6594.

comment:4 Changed 6 years ago by chapoton

  • Description modified (diff)
  • Report Upstream set to N/A
Note: See TracTickets for help on using tickets.