Example #1
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = get_ipython_module_path('IPython.testing.iptest')
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner+self.params
        
        # Find the section we're testing (IPython.foo)
        for sect in self.params:
            if sect.startswith('IPython'): break
        else:
            raise ValueError("Section not found", self.params)
        
        if '--with-xunit' in self.call_args:
            self.call_args.append('--xunit-file=%s' % path.abspath(sect+'.xunit.xml'))
        
        if '--with-xml-coverage' in self.call_args:
            self.coverage_xml = path.abspath(sect+".coverage.xml")
            self.call_args.remove('--with-xml-coverage')
            self.call_args = ["coverage", "run", "--source="+sect] + self.call_args[1:]

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #2
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = get_ipython_module_path('IPython.testing.iptest')
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner+self.params
        
        # Find the section we're testing (IPython.foo)
        for sect in self.params:
            if sect.startswith('IPython'): break
        else:
            raise ValueError("Section not found", self.params)
        
        if '--with-xunit' in self.call_args:
            self.call_args.append('--xunit-file=%s' % path.abspath(sect+'.xunit.xml'))
        
        if '--with-xml-coverage' in self.call_args:
            self.coverage_xml = path.abspath(sect+".coverage.xml")
            self.call_args.remove('--with-xml-coverage')
            self.call_args = ["coverage", "run", "--source="+sect] + self.call_args[1:]

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #3
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = get_ipython_module_path('IPython.testing.iptest')
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner+self.params
        
        print self.call_args
        if '--with-xunit' in self.call_args:
            sect = [p for p in self.params if p.startswith('IPython')][0]
            self.call_args.append('--xunit-file=%s' % path.abspath(sect+'.xunit.xml'))

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #4
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = get_ipython_module_path('IPython.testing.iptest')
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner+self.params

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #5
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = get_ipython_module_path('IPython.testing.iptest')
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner + self.params

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #6
0
    def __init__(self, runner='iptest', params=None):
        """Create new test runner."""
        p = os.path
        if runner == 'iptest':
            iptest_app = os.path.abspath(
                get_ipython_module_path('IPython.testing.iptest'))
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception('Not a valid test runner: %s' % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner + self.params

        # Find the section we're testing (IPython.foo)
        for sect in self.params:
            if sect.startswith('IPython') or sect in special_test_suites: break
        else:
            raise ValueError("Section not found", self.params)

        if '--with-xunit' in self.call_args:

            self.call_args.append('--xunit-file')
            # FIXME: when Windows uses subprocess.call, these extra quotes are unnecessary:
            xunit_file = path.abspath(sect + '.xunit.xml')
            if sys.platform == 'win32':
                xunit_file = '"%s"' % xunit_file
            self.call_args.append(xunit_file)

        if '--with-xml-coverage' in self.call_args:
            self.coverage_xml = path.abspath(sect + ".coverage.xml")
            self.call_args.remove('--with-xml-coverage')
            self.call_args = ["coverage", "run", "--source=" + sect
                              ] + self.call_args[1:]

        # Store anything we start to clean up on deletion
        self.processes = []
Example #7
0
    def __init__(self, runner="iptest", params=None):
        """Create new test runner."""
        p = os.path
        if runner == "iptest":
            iptest_app = os.path.abspath(get_ipython_module_path("IPython.testing.iptest"))
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        else:
            raise Exception("Not a valid test runner: %s" % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner + self.params

        # Find the section we're testing (IPython.foo)
        for sect in self.params:
            if sect.startswith("IPython") or sect in special_test_suites:
                break
        else:
            raise ValueError("Section not found", self.params)

        if "--with-xunit" in self.call_args:

            self.call_args.append("--xunit-file")
            # FIXME: when Windows uses subprocess.call, these extra quotes are unnecessary:
            xunit_file = path.abspath(sect + ".xunit.xml")
            if sys.platform == "win32":
                xunit_file = '"%s"' % xunit_file
            self.call_args.append(xunit_file)

        if "--with-xml-coverage" in self.call_args:
            self.coverage_xml = path.abspath(sect + ".coverage.xml")
            self.call_args.remove("--with-xml-coverage")
            self.call_args = ["coverage", "run", "--source=" + sect] + self.call_args[1:]

        # Store anything we start to clean up on deletion
        self.processes = []
Example #8
0
    def __init__(self, runner="iptest", params=None):
        """Create new test runner."""
        p = os.path
        if runner == "iptest":
            iptest_app = get_ipython_module_path("IPython.testing.iptest")
            self.runner = pycmd2argv(iptest_app) + sys.argv[1:]
        elif runner == "trial":
            # For trial, it needs to be installed system-wide
            self.runner = pycmd2argv(p.abspath(find_cmd("trial")))
        else:
            raise Exception("Not a valid test runner: %s" % repr(runner))
        if params is None:
            params = []
        if isinstance(params, str):
            params = [params]
        self.params = params

        # Assemble call
        self.call_args = self.runner + self.params

        # Store pids of anything we start to clean up on deletion, if possible
        # (on posix only, since win32 has no os.kill)
        self.pids = []
Example #9
0
def test_get_ipython_module_path():
    ipapp_path = path.get_ipython_module_path('IPython.terminal.ipapp')
    nt.assert_true(os.path.isfile(ipapp_path))
Example #10
0
def test_get_ipython_module_path():
    ipapp_path = path.get_ipython_module_path('IPython.frontend.terminal.ipapp')
    nt.assert_true(os.path.isfile(ipapp_path))
Example #11
0
from IPython.utils.traitlets import Any, Int, List, Unicode, Dict, Instance
from IPython.utils.path import get_ipython_module_path
from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError

from .win32support import forward_read_events

from .winhpcjob import IPControllerTask, IPEngineTask, IPControllerJob, IPEngineSetJob

WINDOWS = os.name == 'nt'

#-----------------------------------------------------------------------------
# Paths to the kernel apps
#-----------------------------------------------------------------------------

ipcluster_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.parallel.apps.ipclusterapp'))

ipengine_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.parallel.apps.ipengineapp'))

ipcontroller_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.parallel.apps.ipcontrollerapp'))

#-----------------------------------------------------------------------------
# Base launchers and errors
#-----------------------------------------------------------------------------


class LauncherError(Exception):
    pass
Example #12
0
from IPython.utils.path import get_ipython_module_path
from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError

from .win32support import forward_read_events

from .winhpcjob import IPControllerTask, IPEngineTask, IPControllerJob, IPEngineSetJob

WINDOWS = os.name == 'nt'

#-----------------------------------------------------------------------------
# Paths to the kernel apps
#-----------------------------------------------------------------------------


ipcluster_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipclusterapp'
))

ipengine_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipengineapp'
))

ipcontroller_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipcontrollerapp'
))

#-----------------------------------------------------------------------------
# Base launchers and errors
#-----------------------------------------------------------------------------

Example #13
0
from IPython.utils.path import get_ipython_module_path
from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError

from .win32support import forward_read_events

from .winhpcjob import IPControllerTask, IPEngineTask, IPControllerJob, IPEngineSetJob

WINDOWS = os.name == 'nt'

#-----------------------------------------------------------------------------
# Paths to the kernel apps
#-----------------------------------------------------------------------------


ipcluster_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipclusterapp'
))

ipengine_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipengineapp'
))

ipcontroller_cmd_argv = pycmd2argv(get_ipython_module_path(
    'IPython.parallel.apps.ipcontrollerapp'
))

#-----------------------------------------------------------------------------
# Base launchers and errors
#-----------------------------------------------------------------------------

Example #14
0
def test_get_ipython_module_path():
    ipapp_path = path.get_ipython_module_path("IPython.terminal.ipapp")
    nt.assert_true(os.path.isfile(ipapp_path))
Example #15
0
                                      IPControllerJob, IPEngineSetJob)

from twisted.internet import reactor, defer
from twisted.internet.defer import inlineCallbacks
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.utils import getProcessOutput
from twisted.internet.error import ProcessDone, ProcessTerminated
from twisted.python import log
from twisted.python.failure import Failure

#-----------------------------------------------------------------------------
# Paths to the kernel apps
#-----------------------------------------------------------------------------

ipcluster_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.kernel.ipclusterapp'))

ipengine_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.kernel.ipengineapp'))

ipcontroller_cmd_argv = pycmd2argv(
    get_ipython_module_path('IPython.kernel.ipcontrollerapp'))

#-----------------------------------------------------------------------------
# Base launchers and errors
#-----------------------------------------------------------------------------


class LauncherError(Exception):
    pass
Example #16
0
def test_get_ipython_module_path():
    ipapp_path = path.get_ipython_module_path('IPython.core.ipapp')
    nt.assert_true(os.path.isfile(ipapp_path))