iptest
47 lines
| 1.1 KiB
| text/plain
|
TextLexer
/ scripts / iptest
Fernando Perez
|
r1564 | #!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||||
"""IPython Test Suite Runner. | ||||
""" | ||||
import sys | ||||
import warnings | ||||
from nose.core import TestProgram | ||||
import nose.plugins.builtin | ||||
from IPython.testing.plugin.ipdoctest import IPythonDoctest | ||||
def main(): | ||||
"""Run the IPython test suite. | ||||
""" | ||||
warnings.filterwarnings('ignore', | ||||
'This will be removed soon. Use IPython.testing.util instead') | ||||
# construct list of plugins, omitting the existing doctest plugin | ||||
plugins = [IPythonDoctest()] | ||||
for p in nose.plugins.builtin.plugins: | ||||
plug = p() | ||||
if plug.name == 'doctest': | ||||
continue | ||||
#print 'adding plugin:',plug.name # dbg | ||||
plugins.append(plug) | ||||
argv = sys.argv + ['--doctest-tests','--doctest-extension=txt', | ||||
'--with-ipdoctest','--exe'] | ||||
has_ip = False | ||||
for arg in sys.argv: | ||||
if 'IPython' in arg: | ||||
has_ip = True | ||||
break | ||||
if not has_ip: | ||||
argv.append('IPython') | ||||
TestProgram(argv=argv,plugins=plugins) | ||||
if __name__ == '__main__': | ||||
main() | ||||