Ticket #12849: 12849_doctest.patch

File 12849_doctest.patch, 1.2 KB (added by Jeroen Demeyer, 10 years ago)

Doctest for the issue

  • sage/misc/sagedoc.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1334740233 -7200
    # Node ID c56b00b6700f31892ae3156373d4f7a027bdde72
    # Parent  a69c45014e4aafb0613ee5170fac321c207cb896
    Add doctest to check argspecs of extension function/methods
    
    diff --git a/sage/misc/sagedoc.py b/sage/misc/sagedoc.py
    a b  
    1212- John Palmieri (2009-06-28): don't use 'find' -- use Python (os.walk, re.search) instead.
    1313- Simon King (2011-09-19): use os.linesep, avoid destruction of embedding information,
    1414  enable nodetex in a docstring.
     15
     16TESTS:
     17
     18Check that argspecs of extension function/methods appear correctly,
     19see :trac:`12849`::
     20   
     21    sage: docfilename = os.path.join(SAGE_ROOT, 'devel', 'sage', 'doc', 'output', 'html', 'en', 'reference', 'sage', 'symbolic', 'expression.html')
     22    sage: for line in open(docfilename):
     23    ...       if "#sage.symbolic.expression.Expression.N" in line:
     24    ...           print line
     25    <tt class="descname">N</tt><big>(</big><em>prec=None</em>, <em>digits=None</em><big>)</big>...
    1526"""
    1627#*****************************************************************************
    1728#       Copyright (C) 2005 William Stein <wstein@gmail.com>