def test_reset():
 ip.reset()
 nvars_user_ns = len(ip.user_ns)
 nvars_hidden = len(ip.user_ns_hidden)
 ip.user_ns['x'] = 1
 ip.user_ns['y'] = 1
 ip.reset()
 nt.assert_equal(len(ip.user_ns), nvars_user_ns)
 nt.assert_equal(len(ip.user_ns_hidden), nvars_hidden)

def test_reset ( ) : ip . reset ( ) nvars_user_ns = len ( ip . user_ns ) nvars_hidden = len ( ip . user_ns_hidden ) ip . user_ns [ 'x' ] = 1 ip . user_ns [ 'y' ] = 1 ip . reset ( ) nt . assert_equal ( len ( ip . user_ns ) , nvars_user_ns ) nt . assert_equal ( len ( ip . user_ns_hidden ) , nvars_hidden )
reset must clear most namespaces .