Ticket #14070: 14070_ipython_test_shell_empty_argv.patch

File 14070_ipython_test_shell_empty_argv.patch, 1.5 KB (added by jdemeyer, 8 years ago)
  • sage/misc/interpreter.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1360166933 -3600
    # Node ID e46d771d40341afca32d112add3535034ef938c6
    # Parent  c4316fb58996251555600d40ae9b577b4012690a
    Start IPython shell with empty argv
    
    diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
    a b  
    598598        sage: from sage.misc.interpreter import get_test_shell
    599599        sage: shell = get_test_shell(); shell
    600600        <sage.misc.interpreter.SageInteractiveShell object at 0x...>
     601
     602    TESTS:
     603
     604    Check that :trac:`14070` has been resolved::
     605
     606        sage: from sage.tests.cmdline import test_executable
     607        sage: cmd = 'from sage.misc.interpreter import get_test_shell; shell = get_test_shell()'
     608        sage: (out, err, ret) = test_executable(["sage", "-c", cmd])
     609        sage: out + err
     610        ''
    601611    """
    602612    app = SageTerminalApp.instance(config=DEFAULT_SAGE_CONFIG)
    603613    if app.shell is None:
    604         app.initialize()
     614        app.initialize(argv=[])
    605615    return app.shell
    606616
    607617
     
    683693
    684694            sage: from sage.misc.interpreter import SageTerminalApp, DEFAULT_SAGE_CONFIG
    685695            sage: app = SageTerminalApp(config=DEFAULT_SAGE_CONFIG)
    686             sage: app.initialize() #indirect doctest
     696            sage: app.initialize(argv=[])  # indirect doctest
    687697            sage: app.shell
    688698            <sage.misc.interpreter.SageInteractiveShell object at 0x...>
    689699        """