##// END OF EJS Templates
Fix printing of argparse help to go to stdout by default....
Fix printing of argparse help to go to stdout by default. Our help message was tricky to page because it went to stderr (argparse default, which I don't particularly like). Also fixed encoding marker, which was incorrect. The problem exists in other files too, the right syntax is: # coding: utf-8 (with 'coding', not 'encoding'). See http://www.python.org/dev/peps/pep-0263

File last commit:

r964:0a2f2117
r2361:ccf5098a
Show More
runtests.py
31 lines | 713 B | text/x-python | PythonLexer
""" Run ipython unit tests
This should be launched from inside ipython by "%run runtests.py"
or through ipython command line "ipython runtests.py".
"""
from IPython.external.path import path
import pprint,os
import IPython.ipapi
ip = IPython.ipapi.get()
def main():
all = path('.').files('test_*py')
results = {}
res_exc = [None]
def exchook(self,*e):
res_exc[0] = [e]
ip.IP.set_custom_exc((Exception,), exchook)
startdir = os.getcwd()
for test in all:
print test
res_exc[0] = 'ok'
os.chdir(startdir)
ip.runlines(test.text())
results[str(test)] = res_exc[0]
os.chdir(startdir)
pprint.pprint(results)
main()