<s> """<STR_LIT>""" <EOL> import os <EOL> import shutil <EOL> import tempfile <EOL> import nose . tools as nt <EOL> from IPython . testing import decorators as dec <EOL> from IPython . testing . globalipapp import get_ipython <EOL> ip = get_ipython ( ) <EOL> @ dec . parametric <EOL> def test_reset ( ) : <EOL> """<STR_LIT>""" <EOL> nvars_config_ns = len ( ip . user_ns_hidden ) <EOL> ip . reset ( ) <EOL> nvars_user_ns = len ( ip . user_ns ) <EOL> ip . user_ns [ '<STR_LIT:x>' ] = <NUM_LIT:1> <EOL> ip . user_ns [ '<STR_LIT:y>' ] = <NUM_LIT:1> <EOL> ip . reset ( ) <EOL> for ns in ip . ns_refs_table : <EOL> if ns is ip . user_ns : <EOL> nvars_expected = nvars_user_ns <EOL> elif ns is ip . user_ns_hidden : <EOL> nvars_expected = nvars_config_ns <EOL> else : <EOL> nvars_expected = <NUM_LIT:0> <EOL> yield nt . assert_equals ( len ( ns ) , nvars_expected ) <EOL> def doctest_tb_plain ( ) : <EOL> """<STR_LIT>""" <EOL> def doctest_tb_context ( ) : <EOL> """<STR_LIT>""" <EOL> def doctest_tb_verbose ( ) : <EOL> """<STR_LIT>""" <EOL> def doctest_tb_sysexit ( ) : <EOL> """<STR_LIT>""" <EOL> def test_run_cell ( ) : <EOL> import textwrap <EOL> ip . run_cell ( '<STR_LIT>' ) <EOL> ip . run_cell ( '<STR_LIT>' ) <EOL> nt . assert_equals ( ip . user_ns [ '<STR_LIT:a>' ] , <NUM_LIT:11> ) <EOL> complex = textwrap . dedent ( """<STR_LIT>""" ) <EOL> ip . run_cell ( complex ) <EOL> def test_db ( ) : <EOL> """<STR_LIT>""" <EOL> ip . db [ '<STR_LIT>' ] = <NUM_LIT:12> <EOL> nt . assert_equals ( ip . db [ '<STR_LIT>' ] , <NUM_LIT:12> ) <EOL> del ip . db [ '<STR_LIT>' ] <EOL> assert '<STR_LIT>' not in ip . db </s>
