Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 v():
return core.Vulture(verbose=True)
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})