__init__.py
49 lines
| 1.7 KiB
| text/x-python
|
PythonLexer
Fernando Perez
|
r2397 | """Testing support (tools to test IPython itself). | ||
""" | ||||
Brian Granger
|
r2498 | #----------------------------------------------------------------------------- | ||
Matthias BUSSONNIER
|
r5390 | # Copyright (C) 2009-2011 The IPython Development Team | ||
Brian Granger
|
r2498 | # | ||
# Distributed under the terms of the BSD License. The full license is in | ||||
# the file COPYING, distributed as part of this software. | ||||
#----------------------------------------------------------------------------- | ||||
Miro Hrončok
|
r25049 | |||
import os | ||||
Brian Granger
|
r2498 | #----------------------------------------------------------------------------- | ||
# Functions | ||||
#----------------------------------------------------------------------------- | ||||
Fernando Perez
|
r2397 | # User-level entry point for testing | ||
Thomas Kluyver
|
r13742 | def test(**kwargs): | ||
Fernando Perez
|
r2397 | """Run the entire IPython test suite. | ||
Thomas Kluyver
|
r13742 | Any of the options for run_iptestall() may be passed as keyword arguments. | ||
Paul Ivanov
|
r13743 | |||
Thomas Kluyver
|
r13745 | For example:: | ||
Paul Ivanov
|
r13743 | |||
IPython.test(testgroups=['lib', 'config', 'utils'], fast=2) | ||||
will run those three sections of the test suite, using two processes. | ||||
Thomas Kluyver
|
r13742 | """ | ||
Fernando Perez
|
r2397 | |||
# Do the import internally, so that this function doesn't increase total | ||||
# import time | ||||
Thomas Kluyver
|
r13740 | from .iptestcontroller import run_iptestall, default_options | ||
options = default_options() | ||||
Thomas Kluyver
|
r13742 | for name, val in kwargs.items(): | ||
setattr(options, name, val) | ||||
Thomas Kluyver
|
r13740 | run_iptestall(options) | ||
Fernando Perez
|
r2397 | |||
Miro Hrončok
|
r25049 | #----------------------------------------------------------------------------- | ||
# Constants | ||||
#----------------------------------------------------------------------------- | ||||
# We scale all timeouts via this factor, slow machines can increase it | ||||
IPYTHON_TESTING_TIMEOUT_SCALE = float(os.getenv( | ||||
'IPYTHON_TESTING_TIMEOUT_SCALE', 1)) | ||||
Fernando Perez
|
r2397 | # So nose doesn't try to run this as a test itself and we end up with an | ||
# infinite test loop | ||||
test.__test__ = False | ||||