aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources/tests/test_resources.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources/tests/test_resources.py')
-rw-r--r--pkg_resources/tests/test_resources.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py
index 5f084001..1444b9ba 100644
--- a/pkg_resources/tests/test_resources.py
+++ b/pkg_resources/tests/test_resources.py
@@ -509,6 +509,28 @@ class TestParsing:
with pytest.raises(ValueError):
Requirement.parse("#")
+ def test_requirements_with_markers(self):
+ assert (
+ Requirement.parse("foobar;os_name=='a'")
+ ==
+ Requirement.parse("foobar;os_name=='a'")
+ )
+ assert (
+ Requirement.parse("name==1.1;python_version=='2.7'")
+ !=
+ Requirement.parse("name==1.1;python_version=='3.3'")
+ )
+ assert (
+ Requirement.parse("name==1.0;python_version=='2.7'")
+ !=
+ Requirement.parse("name==1.2;python_version=='2.7'")
+ )
+ assert (
+ Requirement.parse("name[foo]==1.0;python_version=='3.3'")
+ !=
+ Requirement.parse("name[foo,bar]==1.0;python_version=='3.3'")
+ )
+
def test_local_version(self):
req, = parse_requirements('foo==1.0.org1')