In test_site, correctly escape backslashes in path names.

This allows the test to pass when the username begins with a lowercase 't'...
This commit is contained in:
Amaury Forgeot d'Arc 2008-06-19 21:17:12 +00:00
parent 8e5cd75b73
commit 9b69ed9d67
1 changed files with 3 additions and 3 deletions

View File

@ -101,17 +101,17 @@ class HelperFunctionsTests(unittest.TestCase):
self.assert_(usersite in sys.path)
rc = subprocess.call([sys.executable, '-c',
'import sys; sys.exit("%s" in sys.path)' % usersite])
'import sys; sys.exit(%r in sys.path)' % usersite])
self.assertEqual(rc, 1)
rc = subprocess.call([sys.executable, '-s', '-c',
'import sys; sys.exit("%s" in sys.path)' % usersite])
'import sys; sys.exit(%r in sys.path)' % usersite])
self.assertEqual(rc, 0)
env = os.environ.copy()
env["PYTHONNOUSERSITE"] = "1"
rc = subprocess.call([sys.executable, '-c',
'import sys; sys.exit("%s" in sys.path)' % usersite],
'import sys; sys.exit(%r in sys.path)' % usersite],
env=env)
self.assertEqual(rc, 0)