From dd5caefb987dbd15495047fc653fa71d4667eb43 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 15 Apr 2016 09:03:49 +0200 Subject: Always inject extra into the environment when evaluating markers. Fixes #544. --- pkg_resources/tests/test_resources.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'pkg_resources/tests') diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 0a72d941..31847dc8 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -189,7 +189,7 @@ class TestDistro: def test_environment_marker_evaluation_called(self): """ If one package foo requires bar without any extras, - markers should pass for bar. + markers should pass for bar without extras. """ parent_req, = parse_requirements("foo") req, = parse_requirements("bar;python_version>='2'") @@ -201,14 +201,6 @@ class TestDistro: req_extras = pkg_resources._ReqExtras({req: parent_req.extras}) assert req_extras.markers_pass(req) - # extra should not be present in the marker namespace if - # no markers were supplied - parent_req, = parse_requirements("foo") - req, = parse_requirements("bar;extra==''") - req_extras = pkg_resources._ReqExtras({req: parent_req.extras}) - with pytest.raises(packaging.markers.UndefinedEnvironmentName): - req_extras.markers_pass(req) - def test_marker_evaluation_with_extras(self): """Extras are also evaluated as markers at resolution time.""" ad = pkg_resources.Environment([]) -- cgit v1.2.1