Author: Antonio Cuni <[email protected]>
Branch: 
Changeset: r44296:f75a360e5b86
Date: 2011-05-19 10:57 +0200
http://bitbucket.org/pypy/pypy/changeset/f75a360e5b86/

Log:    make sure to import site for this test, else it fails inside
        virtualenv

diff --git a/pypy/module/pypyjit/test_pypy_c/test_model.py 
b/pypy/module/pypyjit/test_pypy_c/test_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_model.py
@@ -20,7 +20,7 @@
     def setup_method(self, meth):
         self.filepath = self.tmpdir.join(meth.im_func.func_name + '.py')
 
-    def run(self, func_or_src, args=[], **jitopts):
+    def run(self, func_or_src, args=[], import_site=False, **jitopts):
         src = py.code.Source(func_or_src)
         if isinstance(func_or_src, types.FunctionType):
             funcname = func_or_src.func_name
@@ -39,7 +39,9 @@
         # run a child pypy-c with logging enabled
         logfile = self.filepath.new(ext='.log')
         #
-        cmdline = [sys.executable, '-S']
+        cmdline = [sys.executable]
+        if not import_site:
+            cmdline.append('-S')
         for key, value in jitopts.iteritems():
             cmdline += ['--jit', '%s=%s' % (key, value)]
         cmdline.append(str(self.filepath))
@@ -465,7 +467,7 @@
                 j = ntohs(1) # ID: ntohs
                 a = 0
             return i
-        log = self.run(f)
+        log = self.run(f, import_site=True)
         loop, = log.loops_by_id('ntohs')
         assert loop.match_by_id('ntohs', """
             guard_not_invalidated(descr=...)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to