aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kowalik <steven@wedontsleep.org>2016-03-08 10:38:59 +1100
committerSteve Kowalik <steven@wedontsleep.org>2016-03-08 10:38:59 +1100
commit280cce52534dc639fbb2064fa2e2d1e597901882 (patch)
treede841c663e174d4e38de942827642a256fba14ee
parentbd090b8067e77d30325f5b8acc22f9b323c7c222 (diff)
downloadexternal_python_setuptools-280cce52534dc639fbb2064fa2e2d1e597901882.tar.gz
external_python_setuptools-280cce52534dc639fbb2064fa2e2d1e597901882.tar.bz2
external_python_setuptools-280cce52534dc639fbb2064fa2e2d1e597901882.zip
Add in a test that checks comparsion of Requirement with markers
-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')