Python coverage 模块,exe() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用coverage.exe()

项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if sys.platform == 'win32':
        # When running coverage as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # filenames.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if sys.platform == 'win32':
        # When running coverage as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # filenames.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')
项目:Chromium_DepotTools    作者:p07r0457    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if sys.platform == 'win32':
        # When running coverage as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # filenames.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')
项目:node-gn    作者:Shouqun    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if sys.platform == 'win32':
        # When running coverage as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # filenames.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')
项目:depot_tools    作者:webrtc-uwp    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if sys.platform == 'win32':
        # When running coverage as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # filenames.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')
项目:Hawkeye    作者:tozhengxq    | 项目源码 | 文件源码
def __init__(self, _covpkg=None, _run_python_file=None,
                 _run_python_module=None, _help_fn=None, _path_exists=None):
        # _covpkg is for dependency injection, so we can test this code.
        if _covpkg:
            self.covpkg = _covpkg
        else:
            import coverage
            self.covpkg = coverage

        # For dependency injection:
        self.run_python_file = _run_python_file or run_python_file
        self.run_python_module = _run_python_module or run_python_module
        self.help_fn = _help_fn or self.help
        self.path_exists = _path_exists or os.path.exists
        self.global_option = False

        self.coverage = None

        self.program_name = os.path.basename(sys.argv[0])
        if env.WINDOWS:
            # entry_points={'console_scripts':...} on Windows makes files
            # called coverage.exe, coverage3.exe, and coverage-3.5.exe. These
            # invoke coverage-script.py, coverage3-script.py, and
            # coverage-3.5-script.py.  argv[0] is the .py file, but we want to
            # get back to the original form.
            auto_suffix = "-script.py"
            if self.program_name.endswith(auto_suffix):
                self.program_name = self.program_name[:-len(auto_suffix)]
项目:Hawkeye    作者:tozhengxq    | 项目源码 | 文件源码
def unshell_list(s):
    """Turn a command-line argument into a list."""
    if not s:
        return None
    if env.WINDOWS:
        # When running coverage.py as coverage.exe, some of the behavior
        # of the shell is emulated: wildcards are expanded into a list of
        # file names.  So you have to single-quote patterns on the command
        # line, but (not) helpfully, the single quotes are included in the
        # argument, so we have to strip them off here.
        s = s.strip("'")
    return s.split(',')