##// END OF EJS Templates
Adding information about IPYTHONDIR to usage of ipcluster and friends.
Adding information about IPYTHONDIR to usage of ipcluster and friends.

File last commit:

r1910:8bc770ab
r1959:7604468a
Show More
iptest.py
100 lines | 3.9 KiB | text/x-python | PythonLexer
Fernando Perez
Add module I forgot
r1574 # -*- coding: utf-8 -*-
"""IPython Test Suite Runner.
Fernando Perez
Cleanup testing machinery.
r1851
This module provides a main entry point to a user script to test IPython itself
from the command line. The main() routine can be used in a similar manner to
the ``nosetests`` script, and it takes similar arguments, but if no arguments
are given it defaults to testing all of IPython. This should be preferred to
using plain ``nosetests`` because a number of nose plugins necessary to test
IPython correctly are automatically configured by this code.
Fernando Perez
Add module I forgot
r1574 """
Fernando Perez
Cleanup testing machinery.
r1851 #-----------------------------------------------------------------------------
# Module imports
#-----------------------------------------------------------------------------
# stdlib
Fernando Perez
Add module I forgot
r1574 import sys
import warnings
Fernando Perez
Cleanup testing machinery.
r1851 # third-party
Fernando Perez
Add module I forgot
r1574 import nose.plugins.builtin
Fernando Perez
Cleanup testing machinery.
r1851 from nose.core import TestProgram
Fernando Perez
Add module I forgot
r1574
Fernando Perez
Cleanup testing machinery.
r1851 # Our own imports
Fernando Perez
Add module I forgot
r1574 from IPython.testing.plugin.ipdoctest import IPythonDoctest
Fernando Perez
Cleanup testing machinery.
r1851 #-----------------------------------------------------------------------------
# Constants and globals
#-----------------------------------------------------------------------------
# For the IPythonDoctest plugin, we need to exclude certain patterns that cause
# testing problems. We should strive to minimize the number of skipped
# modules, since this means untested code. As the testing machinery
# solidifies, this list should eventually become empty.
EXCLUDE = ['IPython/external/',
'IPython/platutils_win32',
'IPython/frontend/cocoa',
'IPython_doctest_plugin',
'IPython/Gnuplot',
'IPython/Extensions/ipy_',
'IPython/Extensions/clearcmd',
'IPython/Extensions/PhysicalQIn',
'IPython/Extensions/scitedirector',
]
#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------
Fernando Perez
Add module I forgot
r1574 def main():
"""Run the IPython test suite.
"""
warnings.filterwarnings('ignore',
'This will be removed soon. Use IPython.testing.util instead')
Brian Granger
Temporarily disabling the ipdoctest nose plugin....
r1888 argv = sys.argv + [
# Loading ipdoctest causes problems with Twisted.
# I am removing this as a temporary fix to get the
# test suite back into working shape. Our nose
# plugin needs to be gone through with a fine
# toothed comb to find what is causing the problem.
# '--with-ipdoctest',
Fernando Perez
- Make ipdoctest a little cleaner by giving it separate option names....
r1910 '--ipdoctest-tests','--ipdoctest-extension=txt',
Fernando Perez
Fixes to testing system: ipdocetst plugin wasn't being properly loaded.
r1761 '--detailed-errors',
Fernando Perez
Add module I forgot
r1574
Fernando Perez
Fixes to testing system: ipdocetst plugin wasn't being properly loaded.
r1761 # We add --exe because of setuptools' imbecility (it
# blindly does chmod +x on ALL files). Nose does the
# right thing and it tries to avoid executables,
# setuptools unfortunately forces our hand here. This
# has been discussed on the distutils list and the
# setuptools devs refuse to fix this problem!
'--exe',
]
Fernando Perez
Add module I forgot
r1574
Fernando Perez
Update decorators and test scripts.
r1848 # Detect if any tests were required by explicitly calling an IPython
# submodule or giving a specific path
has_tests = False
Fernando Perez
Add module I forgot
r1574 for arg in sys.argv:
Fernando Perez
Update decorators and test scripts.
r1848 if 'IPython' in arg or arg.endswith('.py') or \
(':' in arg and '.py' in arg):
has_tests = True
Fernando Perez
Add module I forgot
r1574 break
Fernando Perez
- Make ipdoctest a little cleaner by giving it separate option names....
r1910
Fernando Perez
Update decorators and test scripts.
r1848 # If nothing was specifically requested, test full IPython
if not has_tests:
Fernando Perez
Add module I forgot
r1574 argv.append('IPython')
Fernando Perez
- Make ipdoctest a little cleaner by giving it separate option names....
r1910 # Construct list of plugins, omitting the existing doctest plugin, which
# ours replaces (and extends).
Fernando Perez
Cleanup testing machinery.
r1851 plugins = [IPythonDoctest(EXCLUDE)]
Fernando Perez
Fixes to testing system: ipdocetst plugin wasn't being properly loaded.
r1761 for p in nose.plugins.builtin.plugins:
plug = p()
if plug.name == 'doctest':
continue
#print '*** adding plugin:',plug.name # dbg
plugins.append(plug)
Fernando Perez
Add module I forgot
r1574 TestProgram(argv=argv,plugins=plugins)