Commit 3d8c2245 authored by Steve Kowalik's avatar Steve Kowalik

Reinstate the or guard in WorkingSet._markers_pass

parent a31716f5
...@@ -861,7 +861,7 @@ class WorkingSet(object): ...@@ -861,7 +861,7 @@ class WorkingSet(object):
result = [] result = []
if req in extra_req_mapping: if req in extra_req_mapping:
for extra in extra_req_mapping[req]: for extra in extra_req_mapping[req] or ['']:
result.append(req.marker.evaluate({'extra': extra})) result.append(req.marker.evaluate({'extra': extra}))
else: else:
result.append(req.marker.evaluate()) result.append(req.marker.evaluate())
......
...@@ -186,6 +186,12 @@ class TestDistro: ...@@ -186,6 +186,12 @@ class TestDistro:
res = ws.resolve(parse_requirements("Foo;python_version>='2'"), ad) res = ws.resolve(parse_requirements("Foo;python_version>='2'"), ad)
assert list(res) == [Foo] assert list(res) == [Foo]
def test_environment_marker_evaluation_called(self):
ws = WorkingSet([])
req, = parse_requirements("bar;python_version<'4'")
extra_req_mapping = {req: ()}
assert ws._markers_pass(req, extra_req_mapping) == True
def test_marker_evaluation_with_extras(self): def test_marker_evaluation_with_extras(self):
"""Extras are also evaluated as markers at resolution time.""" """Extras are also evaluated as markers at resolution time."""
ad = pkg_resources.Environment([]) ad = pkg_resources.Environment([])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment