Ticket #13678: 13678-doctests.patch

File 13678-doctests.patch, 3.5 KB (added by robertwb, 9 years ago)
  • sage/matrix/constructor.py

    # HG changeset patch
    # User Robert Bradshaw <robertwb@math.washington.edu>
    # Date 1356775206 28800
    # Node ID 305b8c4e284fd3a5eb94e88595059ae0a11e388c
    # Parent  7eed6c4139cba724c5c4d807365abc18e7de1fc6
    Fix doctests due to docstring changes.
    
    diff --git a/sage/matrix/constructor.py b/sage/matrix/constructor.py
    a b  
    7878
    7979def _matrix_constructor(*args, **kwds):
    8080    """
    81     Create a matrix. 
     81    Create a matrix.
    8282
    8383    This implements the ``matrix`` constructor::
    8484
     
    9393        [1 0]
    9494        [0 1]
    9595
    96     INPUT: 
     96    INPUT:
    9797
    9898    The matrix command takes the entries of a matrix, optionally
    9999    preceded by a ring and the dimensions of the matrix, and returns a
     
    748748    __call__ = staticmethod(_matrix_constructor)
    749749
    750750    def _sage_src_(self):
     751        """
     752        For introspection of the global matrix object.
     753       
     754        TESTS::
     755       
     756            sage: from sage.misc.sageinspect import sage_getsource
     757            sage: sage_getsource(matrix) == sage_getsource(sage.matrix.constructor._matrix_constructor)
     758            True
     759        """
    751760        from sage.misc.sageinspect import sage_getsource
    752761        return sage_getsource(_matrix_constructor)
    753762
  • sage/misc/sagedoc.py

    diff --git a/sage/misc/sagedoc.py b/sage/misc/sagedoc.py
    a b  
    479479        <BLANKLINE>
    480480        Definition: identity_matrix(ring, n=0, sparse=False)
    481481        <BLANKLINE>
     482        This function is available as identity_matrix(...) and
     483        matrix.identity(...).
     484        <BLANKLINE>
    482485           Return the n x n identity matrix over the given ring.
    483486        ...
    484487
     
    11721175
    11731176        sage: from sage.misc.sagedoc import my_getsource
    11741177        sage: s = my_getsource(identity_matrix, True)
    1175         sage: s[:19]
     1178        sage: s[15:34]
    11761179        'def identity_matrix'
    11771180    """
    11781181    try:
  • sage/misc/sageinspect.py

    diff --git a/sage/misc/sageinspect.py b/sage/misc/sageinspect.py
    a b  
    11881188    EXAMPLES::
    11891189
    11901190        sage: from sage.misc.sageinspect import _sage_getdoc_unformatted
    1191         sage: _sage_getdoc_unformatted(identity_matrix)[5:44]
     1191        sage: _sage_getdoc_unformatted(identity_matrix)[87:126]
    11921192        'Return the `n \\times n` identity matrix'
    11931193
    11941194    TESTS:
     
    12451245    EXAMPLES::
    12461246
    12471247        sage: from sage.misc.sageinspect import sage_getdoc
    1248         sage: sage_getdoc(identity_matrix)[3:39]
    1249         'Return the n x n identity matrix ove'
     1248        sage: sage_getdoc(identity_matrix)[87:124]
     1249        'Return the n x n identity matrix over'
    12501250        sage: def f(a,b,c,d=1): return a+b+c+d
    12511251        ...
    12521252        sage: import functools
     
    12981298    EXAMPLES::
    12991299
    13001300        sage: from sage.misc.sageinspect import sage_getsource
    1301         sage: sage_getsource(identity_matrix, True)[4:45]
     1301        sage: sage_getsource(identity_matrix, True)[19:60]
    13021302        'identity_matrix(ring, n=0, sparse=False):'
    1303         sage: sage_getsource(identity_matrix, False)[4:45]
     1303        sage: sage_getsource(identity_matrix, False)[19:60]
    13041304        'identity_matrix(ring, n=0, sparse=False):'
    13051305   
    13061306    AUTHORS:
     
    13431343
    13441344        sage: from sage.misc.sageinspect import sage_getsourcelines
    13451345        sage: sage_getsourcelines(matrix, True)[1]
    1346         34
    1347         sage: sage_getsourcelines(matrix, False)[0][0][4:]
    1348         'matrix(*args, **kwds):\n'
     1346        731
     1347        sage: sage_getsourcelines(matrix, False)[0][0][6:]
     1348        'MatrixFactory(object):\n'
    13491349
    13501350    TESTS::
    13511351