From 280cce52534dc639fbb2064fa2e2d1e597901882 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 8 Mar 2016 10:38:59 +1100 Subject: Add in a test that checks comparsion of Requirement with markers --- pkg_resources/tests/test_resources.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'pkg_resources/tests') 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') -- cgit v1.2.1