# Module: `testing.iptestcontroller`

IPython Test Process Controller

This module runs one or more subprocesses which will actually run the IPython test suite.

## 3 Classes

class `IPython.testing.iptestcontroller.``TimeoutExpired`

  Bases: `exceptions.Exception`

class `IPython.testing.iptestcontroller.``TestController`

  Bases: `object`

  Run tests in a subprocess

  `__init__`()
  `cleanup`()

    Kill process if it’s still alive, and clean up temporary directories

  `cleanup_process`()

    Cleanup on exit by killing any leftover processes.

  `print_extra_info`()

    Print extra information about this test run.

    If we’re running in parallel and showing the concise view, this is only called if the test group fails. Otherwise, it’s called before the test group is started.

    The base implementation does nothing, but it can be overridden by subclasses.

  `setup`()

    Create temporary directories etc.

    This is only called when we know the test group will be run. Things created here may be cleaned up by self.cleanup().

class `IPython.testing.iptestcontroller.``PyTestController`(section, options)

  Bases: `IPython.testing.iptestcontroller.TestController`

  Run Python tests using IPython.testing.iptest

  `__init__`(section, options)

    Create new test runner.

  `cleanup`()

    Make the non-accessible directory created in setup() accessible again, otherwise deleting the workingdir will fail.

## 7 Functions

`IPython.testing.iptestcontroller.``popen_wait`(p, timeout)

  backport of Popen.wait from Python 3

`IPython.testing.iptestcontroller.``prepare_controllers`(options)

  Returns two lists of TestController instances, those to run, and those not to run.

`IPython.testing.iptestcontroller.``do_run`(controller, buffer_output=True)

  Setup and run a test controller.

  If buffer_output is True, no output is displayed, to avoid it appearing interleaved. In this case, the caller is responsible for displaying test output on failure.

  Returns: | controller : TestController The same controller as passed in, as a convenience for using map() type APIs. exitcode : int The exit code of the test subprocess. Non-zero indicates failure.

`IPython.testing.iptestcontroller.``report`()

  Return a string with a summary report of test-related variables.

`IPython.testing.iptestcontroller.``run_iptestall`(options)

  Run the entire IPython test suite by calling nose and trial.

  This function constructs `IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose.

  Parameters: | All parameters are passed as attributes of the options object. testgroups : list of str Run only these sections of the test suite. If empty, run all the available sections. fast : int or None Run the test suite in parallel, using n simultaneous processes. If None is passed, one process is used per CPU core. Default 1 (i.e. sequential) inc_slow : bool Include slow tests. By default, these tests aren’t run. url : unicode Address:port to use when running the JS tests. xunit : bool Produce Xunit XML output. This is written to multiple foo.xunit.xml files. coverage : bool or str Measure code coverage from tests. True will store the raw coverage data, or pass ‘html’ or ‘xml’ to get reports. extra_args : list Extra arguments to pass to the test subprocesses, e.g. ‘-v’

`IPython.testing.iptestcontroller.``default_options`()

  Get an argparse Namespace object with the default arguments, to pass to `run_iptestall()`.

`IPython.testing.iptestcontroller.``main`()