diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-18 15:01:44 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-18 15:01:44 -0500 |
commit | b0abfb1c076baced9bf182a357dd47e9482bf065 (patch) | |
tree | 55a30c8bdd916583a818895c0b660f73815202d0 /tests | |
parent | c04abca662dcbffd00d928e06fbf32b9f49f8e57 (diff) | |
parent | 3c86c861ab9665df0e502f250a7471d09240e413 (diff) | |
download | external_python_setuptools-b0abfb1c076baced9bf182a357dd47e9482bf065.tar.gz external_python_setuptools-b0abfb1c076baced9bf182a357dd47e9482bf065.tar.bz2 external_python_setuptools-b0abfb1c076baced9bf182a357dd47e9482bf065.zip |
Merge Python 3 native support from distribute
--HG--
rename : tests/test_distribute_setup.py => tests/test_ez_setup.py
Diffstat (limited to 'tests')
-rw-r--r-- | tests/api_tests.txt | 6 | ||||
-rw-r--r-- | tests/manual_test.py | 2 | ||||
-rw-r--r-- | tests/test_ez_setup.py | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/api_tests.txt b/tests/api_tests.txt index d03da14e..86ca245d 100644 --- a/tests/api_tests.txt +++ b/tests/api_tests.txt @@ -39,7 +39,7 @@ Distributions have various introspectable attributes:: >>> dist.py_version == sys.version[:3] True - >>> print dist.platform + >>> print(dist.platform) None Including various computed attributes:: @@ -199,7 +199,7 @@ shows up once when iterating the working set: You can ask a WorkingSet to ``find()`` a distribution matching a requirement:: >>> from pkg_resources import Requirement - >>> print ws.find(Requirement.parse("Foo==1.0")) # no match, return None + >>> print(ws.find(Requirement.parse("Foo==1.0"))) # no match, return None None >>> ws.find(Requirement.parse("Bar==0.9")) # match, return distribution @@ -222,7 +222,7 @@ distribution is added to a working set. The callback is immediately invoked once for each existing distribution in the working set, and then is called again for new distributions added thereafter:: - >>> def added(dist): print "Added", dist + >>> def added(dist): print("Added %s" % dist) >>> ws.subscribe(added) Added Bar 0.9 >>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12") diff --git a/tests/manual_test.py b/tests/manual_test.py index 44cf2d06..3eab99e1 100644 --- a/tests/manual_test.py +++ b/tests/manual_test.py @@ -9,7 +9,7 @@ import shutil import tempfile from distutils.command.install import INSTALL_SCHEMES from string import Template -from urllib2 import urlopen +from setuptools.compat import urlopen try: import subprocess diff --git a/tests/test_ez_setup.py b/tests/test_ez_setup.py index 922bd884..26881f52 100644 --- a/tests/test_ez_setup.py +++ b/tests/test_ez_setup.py @@ -16,7 +16,7 @@ import ez_setup class TestSetup(unittest.TestCase): def urlopen(self, url): - return open(self.tarball) + return open(self.tarball, 'rb') def setUp(self): self.old_sys_path = copy.copy(sys.path) @@ -27,7 +27,7 @@ class TestSetup(unittest.TestCase): "--dist-dir", "%s" % self.tmpdir) tarball = os.listdir(self.tmpdir)[0] self.tarball = os.path.join(self.tmpdir, tarball) - import urllib2 + from setuptools.compat import urllib2 urllib2.urlopen = self.urlopen def tearDown(self): @@ -37,7 +37,7 @@ class TestSetup(unittest.TestCase): def test_build_egg(self): # making it an egg - egg = _build_egg(self.tarball, self.tmpdir) + egg = _build_egg('Egg to be built', self.tarball, self.tmpdir) # now trying to import it sys.path[0] = egg |