diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-09 08:16:33 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-12-09 08:53:50 -0500 |
commit | f14930e66601b462699c44384c482cd966f53b8f (patch) | |
tree | bea29134419118c1bcb95ca589da5a8e2372e089 /pkg_resources/tests/test_resources.py | |
parent | ac9997648d89131412eacbb198e2d3a7c97f69e4 (diff) | |
download | python-setuptools-git-f14930e66601b462699c44384c482cd966f53b8f.tar.gz |
Drop support for Python 2.6, removing lots of compatibility code for a leaner, cleaner codebase. Fixes #878.
Diffstat (limited to 'pkg_resources/tests/test_resources.py')
-rw-r--r-- | pkg_resources/tests/test_resources.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 00ca7426..8223963c 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -206,12 +206,10 @@ class TestDistro: """Extras are also evaluated as markers at resolution time.""" ad = pkg_resources.Environment([]) ws = WorkingSet([]) - # Metadata needs to be native strings due to cStringIO behaviour in - # 2.6, so use str(). Foo = Distribution.from_filename( "/foo_dir/Foo-1.2.dist-info", - metadata=Metadata(("METADATA", str("Provides-Extra: baz\n" - "Requires-Dist: quux; extra=='baz'"))) + metadata=Metadata(("METADATA", "Provides-Extra: baz\n" + "Requires-Dist: quux; extra=='baz'")) ) ad.add(Foo) assert list(ws.resolve(parse_requirements("Foo"), ad)) == [Foo] @@ -224,12 +222,10 @@ class TestDistro: """Extras are also evaluated as markers at resolution time.""" ad = pkg_resources.Environment([]) ws = WorkingSet([]) - # Metadata needs to be native strings due to cStringIO behaviour in - # 2.6, so use str(). Foo = Distribution.from_filename( "/foo_dir/Foo-1.2.dist-info", - metadata=Metadata(("METADATA", str("Provides-Extra: baz-lightyear\n" - "Requires-Dist: quux; extra=='baz-lightyear'"))) + metadata=Metadata(("METADATA", "Provides-Extra: baz-lightyear\n" + "Requires-Dist: quux; extra=='baz-lightyear'")) ) ad.add(Foo) assert list(ws.resolve(parse_requirements("Foo"), ad)) == [Foo] @@ -241,14 +237,12 @@ class TestDistro: def test_marker_evaluation_with_multiple_extras(self): ad = pkg_resources.Environment([]) ws = WorkingSet([]) - # Metadata needs to be native strings due to cStringIO behaviour in - # 2.6, so use str(). Foo = Distribution.from_filename( "/foo_dir/Foo-1.2.dist-info", - metadata=Metadata(("METADATA", str("Provides-Extra: baz\n" + metadata=Metadata(("METADATA", "Provides-Extra: baz\n" "Requires-Dist: quux; extra=='baz'\n" "Provides-Extra: bar\n" - "Requires-Dist: fred; extra=='bar'\n"))) + "Requires-Dist: fred; extra=='bar'\n")) ) ad.add(Foo) quux = Distribution.from_filename("/foo_dir/quux-1.0.dist-info") @@ -261,22 +255,20 @@ class TestDistro: def test_marker_evaluation_with_extras_loop(self): ad = pkg_resources.Environment([]) ws = WorkingSet([]) - # Metadata needs to be native strings due to cStringIO behaviour in - # 2.6, so use str(). a = Distribution.from_filename( "/foo_dir/a-0.2.dist-info", - metadata=Metadata(("METADATA", str("Requires-Dist: c[a]"))) + metadata=Metadata(("METADATA", "Requires-Dist: c[a]")) ) b = Distribution.from_filename( "/foo_dir/b-0.3.dist-info", - metadata=Metadata(("METADATA", str("Requires-Dist: c[b]"))) + metadata=Metadata(("METADATA", "Requires-Dist: c[b]")) ) c = Distribution.from_filename( "/foo_dir/c-1.0.dist-info", - metadata=Metadata(("METADATA", str("Provides-Extra: a\n" + metadata=Metadata(("METADATA", "Provides-Extra: a\n" "Requires-Dist: b;extra=='a'\n" "Provides-Extra: b\n" - "Requires-Dist: foo;extra=='b'"))) + "Requires-Dist: foo;extra=='b'")) ) foo = Distribution.from_filename("/foo_dir/foo-0.1.dist-info") for dist in (a, b, c, foo): |