Ejemplo n.º 1
0
def task_coverage():
    """show coverage for all modules including tests"""
    cov = Coverage(
        [PythonPackage('import_deps', 'tests')],
        config={'branch':True,},
    )
    yield cov.all() # create task `coverage`
    yield cov.src() # create task `coverage_src`
Ejemplo n.º 2
0
def task_coverage():
    """show coverage for all modules including tests"""
    cov = Coverage([PythonPackage('doit', 'tests')],
                   config=Config(branch=False, parallel=True,
                          omit=['tests/myecho.py', 'tests/sample_process.py'],)
                   )
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 3
0
 def test_cover_src(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg])
     task = list(cov.src('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch `which py.test`',
         'coverage report --show-missing {}'.format(' '.join(pkg.src))
         ]
Ejemplo n.º 4
0
 def test_cover_src(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg])
     task = list(cov.src('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch `which py.test`',
         'coverage report --show-missing {}'.format(' '.join(pkg.src))
     ]
Ejemplo n.º 5
0
def task_coverage():
    """show coverage for all modules including tests"""
    cov = Coverage([PythonPackage('doit', 'tests')],
                   config=Config(branch=False, parallel=True,
                                 concurrency='multiprocessing',
                          omit=['tests/myecho.py', 'tests/sample_process.py'],)
                   )
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 6
0
 def test_cover_all_multiprocessing(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg], config=Config(concurrency='multiprocessing'))
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch --concurrency multiprocessing `which py.test`',
         'coverage report --show-missing {}'.format(' '.join(
             pkg.all_modules()))
     ]
Ejemplo n.º 7
0
 def test_cover_all_multiprocessing(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg], config=Config(concurrency='multiprocessing'))
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch --concurrency multiprocessing `which py.test`',
         'coverage report --show-missing {}'.format(
             ' '.join(pkg.all_modules()))
         ]
Ejemplo n.º 8
0
 def test_all_module(self):
     pkg = PythonModule(str(SAMPLE / 'flake_ok.py'),
                        str(SAMPLE / 'tests/test_flake_ok.py'))
     cov = Coverage([pkg])
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch `which py.test`',
         'coverage report --show-missing {}'.format(
             ' '.join(pkg.all_modules()))
         ]
Ejemplo n.º 9
0
 def test_all_module(self):
     pkg = PythonModule(str(SAMPLE / 'flake_ok.py'),
                        str(SAMPLE / 'tests/test_flake_ok.py'))
     cov = Coverage([pkg])
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --branch `which py.test`',
         'coverage report --show-missing {}'.format(' '.join(
             pkg.all_modules()))
     ]
Ejemplo n.º 10
0
 def test_cover_all_parallel(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg], config=Config(parallel=True, branch=False,
                                         omit=['abc']))
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --parallel-mode `which py.test`',
         'coverage combine',
         'coverage report --show-missing --omit abc {}'.format(
             ' '.join(pkg.all_modules()))
         ]
Ejemplo n.º 11
0
 def test_cover_all_parallel(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg],
                    config=Config(parallel=True, branch=False,
                                  omit=['abc']))
     task = list(cov.all('my_cov'))[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     assert task['actions'] == [
         'coverage run --parallel-mode `which py.test`', 'coverage combine',
         'coverage report --show-missing --omit abc {}'.format(' '.join(
             pkg.all_modules()))
     ]
Ejemplo n.º 12
0
 def test_cover_module(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg])
     tasks = list(cov.by_module('my_cov'))
     assert len(tasks) == 1
     task = tasks[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     src = pkg.src_base + '/flake_ok.py'
     test = pkg.src_base + '/tests/test_flake_ok.py'
     assert task['actions'] == [
         'coverage run --branch `which py.test` {}'.format(test),
         'coverage report --show-missing {}'.format(' '.join([src, test]))
         ]
Ejemplo n.º 13
0
 def test_cover_module(self):
     pkg = PythonPackage(SAMPLE)
     cov = Coverage([pkg])
     tasks = list(cov.by_module('my_cov'))
     assert len(tasks) == 1
     task = tasks[0]
     assert task['verbosity'] == 2
     assert task['basename'] == 'my_cov'
     src = pkg.src_dir + '/flake_ok.py'
     test = pkg.src_dir + '/tests/test_flake_ok.py'
     assert task['actions'] == [
         'coverage run --branch `which py.test` {}'.format(test),
         'coverage report --show-missing {}'.format(' '.join([src, test]))
     ]
Ejemplo n.º 14
0
def task_coverage():
    cov = Coverage([PythonPackage('doitpy', test_path='tests')],
                   config={'branch': False})
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 15
0
def task_coverage():
    """show coverage for all modules including tests"""
    cov = Coverage([PythonPackage('pyreg', 'tests')])
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 16
0
def task_coverage():
    """show coverage for all modules including tests"""
    cov = Coverage([PythonPackage('pyreg', 'tests')])
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 17
0
def task_coverage():
    cov = Coverage([PythonPackage('doitpy', test_path='tests')],
                   config={'branch':False})
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 18
0
def task_coverage():
    cov = Coverage([PythonModule('doitcmd.py', 'test_doitcmd.py')])
    yield cov.all()
    yield cov.src()
Ejemplo n.º 19
0
def task_coverage():
    cov = Coverage([PythonPackage('doitsys', test_path='tests')])
    yield cov.all()
    yield cov.src()
    yield cov.by_module()
Ejemplo n.º 20
0
 def test_init_pkg_instance(self):
     cov = Coverage([PythonPackage(SAMPLE)])
     assert len(cov.pkgs) == 1
     assert cov.pkgs[0].src_dir == str(SAMPLE)