diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2015-05-15 14:48:58 -0700 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2015-05-15 14:48:58 -0700 |
commit | 960d234ef342c6eafa532cba5e17ca86d1995360 (patch) | |
tree | 9cb3dc260f18478271df0335f20137efa78d6613 /runtests.py | |
parent | c65fc9e36b287461040615a452e0268bbca9f3ca (diff) | |
download | numpy-960d234ef342c6eafa532cba5e17ca86d1995360.tar.gz |
MAINT: make runtests.py --python and --ipython a little more ergonomic
I'm tired of having to manually enable warnings and import numpy,
so maybe others are too.
Diffstat (limited to 'runtests.py')
-rwxr-xr-x | runtests.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtests.py b/runtests.py index 738cd7769..cbba68b40 100755 --- a/runtests.py +++ b/runtests.py @@ -126,6 +126,9 @@ def main(argv): extra_argv = extra_argv[1:] if args.python: + # Debugging issues with warnings is much easier if you can see them + print("Enabling display of all warnings") + import warnings; warnings.filterwarnings("always") if extra_argv: # Don't use subprocess, since we don't want to include the # current path in PYTHONPATH. @@ -143,8 +146,12 @@ def main(argv): sys.exit(0) if args.ipython: + # Debugging issues with warnings is much easier if you can see them + print("Enabling display of all warnings and pre-importing numpy as np") + import warnings; warnings.filterwarnings("always") import IPython - IPython.embed(user_ns={}) + import numpy as np + IPython.embed(user_ns={"np": np}) sys.exit(0) if args.shell: |