aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/distutils/tests/test_install.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/tests/test_install.py')
-rw-r--r--Lib/distutils/tests/test_install.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
index f17baa1e50d..cb2e1f28799 100644
--- a/Lib/distutils/tests/test_install.py
+++ b/Lib/distutils/tests/test_install.py
@@ -1,11 +1,12 @@
"""Tests for distutils.command.install."""
import os
+import imp
import sys
import unittest
import site
-from test.test_support import captured_stdout, run_unittest
+from test.support import captured_stdout, run_unittest
from distutils import sysconfig
from distutils.command.install import install
@@ -26,6 +27,7 @@ def _make_ext_name(modname):
class InstallTestCase(support.TempdirManager,
+ support.EnvironGuard,
support.LoggingSilencer,
unittest.TestCase):
@@ -66,10 +68,7 @@ class InstallTestCase(support.TempdirManager,
check_path(cmd.install_data, destination)
def test_user_site(self):
- # site.USER_SITE was introduced in 2.6
- if sys.version < '2.6':
- return
-
+ # test install with --user
# preparing the environment for the test
self.old_user_base = site.USER_BASE
self.old_user_site = site.USER_SITE
@@ -177,7 +176,7 @@ class InstallTestCase(support.TempdirManager,
project_dir, dist = self.create_dist(py_modules=['hello'],
scripts=['sayhi'])
os.chdir(project_dir)
- self.write_file('hello.py', "def main(): print 'o hai'")
+ self.write_file('hello.py', "def main(): print('o hai')")
self.write_file('sayhi', 'from hello import main; main()')
cmd = install(dist)
@@ -194,7 +193,7 @@ class InstallTestCase(support.TempdirManager,
f.close()
found = [os.path.basename(line) for line in content.splitlines()]
- expected = ['hello.py', 'hello.pyc', 'sayhi',
+ expected = ['hello.py', 'hello.%s.pyc' % imp.get_tag(), 'sayhi',
'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
self.assertEqual(found, expected)