Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_dependencies(self, _):
return []
def find_matches(self, r):
assert r is requirement
return [candidate]
def is_satisfied_by(self, r, c):
assert r is requirement
assert c is candidate
return False
resolver = Resolver(Provider(), BaseReporter())
with pytest.raises(InconsistentCandidate) as ctx:
resolver.resolve([requirement])
assert str(ctx.value) == "Provided candidate 'bar' does not satisfy 'foo'"
assert ctx.value.candidate is candidate
assert list(ctx.value.criterion.iter_requirement()) == [requirement]