How to use the vulture.core function in vulture

To help you get started, we’ve selected a few vulture 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 jendrikseipp / vulture / tests / test_confidence.py View on Github external
def check_min_confidence(code, min_confidence, expected):
    v = core.Vulture(verbose=True)
    v.scan(code)
    detected = {
        item.name: item.confidence
        for item in v.get_unused_code(min_confidence=min_confidence)}
    assert detected == expected
github jendrikseipp / vulture / tests / __init__.py View on Github external
def v():
    return core.Vulture(verbose=True)
github jendrikseipp / vulture / tests / test_confidence.py View on Github external
import sys

from vulture import core
from . import skip_if_not_has_async

dc = core.DEFAULT_CONFIDENCE


def check_min_confidence(code, min_confidence, expected):
    v = core.Vulture(verbose=True)
    v.scan(code)
    detected = {
        item.name: item.confidence
        for item in v.get_unused_code(min_confidence=min_confidence)}
    assert detected == expected


def test_confidence_import():
    code = """\
import foo
"""
    check_min_confidence(code, 50, {'foo': 90})