Show More
@@ -0,0 +1,10 b'' | |||||
|
1 | """This tests standard embedding, automatically detecting the module and | |||
|
2 | local namespaces.""" | |||
|
3 | ||||
|
4 | f = set([1,2,3,4,5]) | |||
|
5 | ||||
|
6 | def bar(foo): | |||
|
7 | import IPython | |||
|
8 | IPython.embed(banner1='check f in globals, foo in locals') | |||
|
9 | ||||
|
10 | bar(f) |
@@ -0,0 +1,5 b'' | |||||
|
1 | """This tests passing a dict for the user_ns at shell instantiation.""" | |||
|
2 | from IPython import embed | |||
|
3 | ||||
|
4 | user_ns = dict(cookie='monster') | |||
|
5 | embed(user_ns=user_ns, banner1="check 'cookie' present, locals and globals equivalent") |
@@ -0,0 +1,7 b'' | |||||
|
1 | """This tests passing local_ns and global_ns (for backwards compatibility only) | |||
|
2 | at activation of an embedded shell.""" | |||
|
3 | from IPython.frontend.terminal.embed import InteractiveShellEmbed | |||
|
4 | ||||
|
5 | user_ns = dict(cookie='monster') | |||
|
6 | ISE = InteractiveShellEmbed(banner1='check cookie in locals, and globals empty') | |||
|
7 | ISE(local_ns=user_ns, global_ns={}) |
General Comments 0
You need to be logged in to leave comments.
Login now