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:]
        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 #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:]
        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 #6
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 #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 = 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 #9
0
from IPython.utils.text import EvalFormatter
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 #10
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
#-----------------------------------------------------------------------------