summaryrefslogtreecommitdiff
path: root/pkg_resources/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources/tests')
-rw-r--r--pkg_resources/tests/test_resources.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py
index acc8dc1e..bd074f22 100644
--- a/pkg_resources/tests/test_resources.py
+++ b/pkg_resources/tests/test_resources.py
@@ -201,11 +201,13 @@ class TestDistro:
req_extras = pkg_resources._ReqExtras({req: parent_req.extras})
assert req_extras.markers_pass(req)
- # this is a little awkward; I would want this to fail
+ # extra should not be present in the marker namespace if
+ # no markers were supplied
parent_req, = parse_requirements("foo")
- req, = parse_requirements("bar;python_version>='2' and extra==''")
+ req, = parse_requirements("bar;extra==''")
req_extras = pkg_resources._ReqExtras({req: parent_req.extras})
- assert req_extras.markers_pass(req)
+ 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."""