File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1125,6 +1125,11 @@ def wait():
11251125 print >> Term .cout
11261126 print '*' * 70
11271127
1128+ # Install mode should be re-entrant: if the install dir already exists,
1129+ # bail out cleanly
1130+ if mode == 'install' and os .path .isdir (ipythondir ):
1131+ return
1132+
11281133 cwd = os .getcwd () # remember where we started
11291134 glb = glob .glob
11301135 print '*' * 70
Original file line number Diff line number Diff line change 33
44import nose .tools as nt
55
6+ # Useful global ipapi object and main IPython one
7+ ip = _ip
8+ IP = ip .IP
9+
610
711def test_reset ():
812 """reset must clear most namespaces."""
9- ip = _ip .IP
10- ip .reset () # first, it should run without error
13+ IP .reset () # first, it should run without error
1114 # Then, check that most namespaces end up empty
12- for ns in ip .ns_refs_table :
13- if ns is ip .user_ns :
15+ for ns in IP .ns_refs_table :
16+ if ns is IP .user_ns :
1417 # The user namespace is reset with some data, so we can't check for
1518 # it being empty
1619 continue
1720 nt .assert_equals (len (ns ),0 )
21+
22+
23+ def test_user_setup ():
24+ """make sure that user_setup can be run re-entrantly in 'install' mode.
25+ """
26+ # This should basically run without errors or output.
27+ IP .user_setup (ip .options .ipythondir ,'' ,'install' )
You can’t perform that action at this time.
0 commit comments