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 | c7b3bccdaab158c5f29ddb13b92e8d9d1b4c7bdb (patch) | |
tree | 7278078a7c40860f75ee3e8459a19e367bd57d6a /tests | |
parent | 063908790dd9ca90fb4e08811d1f3b764b8d7a6d (diff) | |
download | python-setuptools-bitbucket-c7b3bccdaab158c5f29ddb13b92e8d9d1b4c7bdb.tar.gz |
Changes to support 2.x and 3.x in the same codebase.
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 |