Ticket #10548: trac_10548-coerce-traceback-doctest.v2.patch

File trac_10548-coerce-traceback-doctest.v2.patch, 1.7 KB (added by kini, 9 years ago)

new doctest

  • sage/all.py

    # HG changeset patch
    # User Maarten Derickx <m.derickx.student@gmail.com>
    # Date 1301006818 25200
    # Node ID 9d6814f3693c1b435fc71f9af8c5d465a80f2ced
    # Parent c942aaac1d2b41ec8df8c677a6c56628aab971b0
    #10548 add doctests to make sure ticket is fixed
    * * *
    #10570 reduce the ammount of stackframes alive at startup
    
    diff --git a/sage/all.py b/sage/all.py
    a b  
    11"""
    22all.py -- much of sage is imported into this module, so you don't
    33          have to import everything individually.
     4   
     5TESTS:
     6   
     7    This is to test #10570. If the number of stackframes at startup
     8    changes due to a patch you made, please check that this was an
     9    intended effect of your patch.
     10
     11    ::
     12       
     13        sage: import gc
     14        sage: import inspect
     15        sage: from sage import *
     16        sage: frames=[x for x in gc.get_objects() if inspect.isframe(x)]
     17        sage: len(frames)
     18        11
     19   
    420"""
    521
    622from __future__ import with_statement
  • sage/modular/modsym/modsym.py

    diff --git a/sage/modular/modsym/modsym.py b/sage/modular/modsym/modsym.py
    a b  
    155155        sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache()
    156156        sage: sage.modular.modsym.modsym._cache.keys()
    157157        []
     158       
     159    TESTS:
     160   
     161        Make sure #10548 is fixed
     162        sage: import gc 
     163        sage: m=ModularSymbols(Gamma1(29))
     164        sage: m=[]
     165        sage: ModularSymbols_clear_cache()
     166        sage: gc.collect() # random
     167        3422
     168        sage: a=[x for x in gc.get_objects() if isinstance(x,sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1)]
     169        sage: a
     170        []
     171
    158172    """
    159173    global _cache
    160174    _cache = {}