How to use the covimerage.get_version function in covimerage

To help you get started, we’ve selected a few covimerage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Vimjas / covimerage / tests / test_cli.py View on Github external
def test_dunder_main_run_help(capfd):
    assert call([sys.executable, '-m', 'covimerage', '--version']) == 0
    out, err = capfd.readouterr()
    lines = out.splitlines()
    assert len(lines) == 1
    assert lines[0].startswith('covimerage, version %s' % get_version())
github Vimjas / covimerage / tests / test_cli.py View on Github external
def test_get_version_message_importerror(monkeypatch_importerror):
    exc = ImportError('failed')
    with monkeypatch_importerror(('coverage',), raise_exc=exc):
        assert get_version_message() == (
            'covimerage, version %s (using Coverage.py unknown (failed))'
            % (get_version(),)
        )
    exc = ImportError
    with monkeypatch_importerror(('coverage',), raise_exc=exc):
        assert get_version_message() == (
            'covimerage, version %s (using Coverage.py unknown ())'
            % (get_version(),)
        )
github Vimjas / covimerage / covimerage / cli.py View on Github external
def get_version_message():
    from . import get_version

    try:
        from coverage import __version__ as coverage_version
    except ImportError as exc:
        coverage_version = 'unknown (%s)' % (exc,)

    return 'covimerage, version %s (using Coverage.py %s)' % (
        get_version(),
        coverage_version,
    )