[tor-commits] [stem/master] Installation test didn't actually exercise python3

atagar at torproject.org atagar at torproject.org
Thu Jun 11 17:10:30 UTC 2015


commit b60583632f72729751433356093e96562b947cf1
Author: Damian Johnson <atagar at torproject.org>
Date:   Thu Jun 11 10:04:33 2015 -0700

    Installation test didn't actually exercise python3
    
    We hardcoded 'python' in the spots where we shelled out, causing us to usually
    do so via python2 even if we're running the tests with python3. Using the
    interpreter we're running the tests with instead.
---
 test/integ/installation.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/integ/installation.py b/test/integ/installation.py
index 1e17568..70a8ad9 100644
--- a/test/integ/installation.py
+++ b/test/integ/installation.py
@@ -1,6 +1,7 @@
 import glob
 import os
 import shutil
+import sys
 import unittest
 
 import stem
@@ -21,14 +22,14 @@ class TestInstallation(unittest.TestCase):
 
     try:
       os.chdir(base_directory)
-      stem.util.system.call('python setup.py install --prefix /tmp/stem_test')
-      stem.util.system.call('python setup.py clean --all')  # tidy up the build directory
+      stem.util.system.call(sys.executable + ' setup.py install --prefix /tmp/stem_test')
+      stem.util.system.call(sys.executable + ' setup.py clean --all')  # tidy up the build directory
       site_packages_paths = glob.glob('/tmp/stem_test/lib*/*/site-packages')
 
       if len(site_packages_paths) != 1:
         self.fail('We should only have a single site-packages directory, but instead had: %s' % site_packages_paths)
 
-      self.assertEqual(stem.__version__, stem.util.system.call(['python', '-c', "import sys;sys.path.insert(0, '%s');import stem;print(stem.__version__)" % site_packages_paths[0]])[0])
+      self.assertEqual(stem.__version__, stem.util.system.call([sys.executable, '-c', "import sys;sys.path.insert(0, '%s');import stem;print(stem.__version__)" % site_packages_paths[0]])[0])
     finally:
       shutil.rmtree('/tmp/stem_test')
       os.chdir(original_cwd)



More information about the tor-commits mailing list