diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-20 22:55:16 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-06-20 22:55:16 +0100 |
commit | 58a658b26d1c95b31d02050dcccd648d2e4ce27b (patch) | |
tree | b9d3e7de6f6d23b91a7afecde3491e99d8cc7069 /tests | |
parent | e63f3e7d864b26529d6b197e053b4084be20decf (diff) | |
download | external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.tar.gz external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.tar.bz2 external_python_setuptools-58a658b26d1c95b31d02050dcccd648d2e4ce27b.zip |
Changes to support 2.x and 3.x in the same codebase.
--HG--
branch : distribute
extra : rebase_source : 7d3608edee54a43789f0574d702fb839628b5071
Diffstat (limited to 'tests')
-rw-r--r-- | tests/install_test.py | 18 | ||||
-rw-r--r-- | tests/manual_test.py | 2 | ||||
-rw-r--r-- | tests/test_distribute_setup.py | 6 |
3 files changed, 13 insertions, 13 deletions
diff --git a/tests/install_test.py b/tests/install_test.py index 02deb818..97b79933 100644 --- a/tests/install_test.py +++ b/tests/install_test.py @@ -1,19 +1,19 @@ -import urllib2 import sys import os +from setuptools.compat import urllib2 if os.path.exists('distribute_setup.py'): - print 'distribute_setup.py exists in the current dir, aborting' + print('distribute_setup.py exists in the current dir, aborting') sys.exit(2) -print '**** Starting Test' -print '\n\n' +print('**** Starting Test') +print('\n\n') is_jython = sys.platform.startswith('java') if is_jython: import subprocess -print 'Downloading bootstrap' +print('Downloading bootstrap') file = urllib2.urlopen('http://nightly.ziade.org/distribute_setup.py') f = open('distribute_setup.py', 'w') f.write(file.read()) @@ -27,7 +27,7 @@ else: res = os.spawnv(os.P_WAIT, sys.executable, args) if res != 0: - print '**** Test failed, please send me the output at tarek@ziade.org' + print('**** Test failed, please send me the output at tarek@ziade.org') os.remove('distribute_setup.py') sys.exit(2) @@ -63,11 +63,11 @@ try: else: res = os.spawnv(os.P_WAIT, sys.executable, args) - print '\n\n' + print('\n\n') if res: - print '**** Test is OK' + print('**** Test is OK') else: - print '**** Test failed, please send me the output at tarek@ziade.org' + print('**** Test failed, please send me the output at tarek@ziade.org') finally: if os.path.exists(script_name): os.remove(script_name) diff --git a/tests/manual_test.py b/tests/manual_test.py index 0d5051f1..223567f4 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_distribute_setup.py b/tests/test_distribute_setup.py index 4151587f..37c6cf82 100644 --- a/tests/test_distribute_setup.py +++ b/tests/test_distribute_setup.py @@ -17,7 +17,7 @@ import distribute_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) @@ -28,7 +28,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): @@ -38,7 +38,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 |