[pypy-commit] pypy py3k: bah, actually fix test_options_i_m: we need to ensure to have the correct pypy package in PYTHONPATH

antocuni noreply at buildbot.pypy.org
Thu Jun 7 22:10:05 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r55481:b3857dd5d88d
Date: 2012-06-07 15:49 +0200
http://bitbucket.org/pypy/pypy/changeset/b3857dd5d88d/

Log:	bah, actually fix test_options_i_m: we need to ensure to have the
	correct pypy package in PYTHONPATH

diff --git a/pypy/translator/goal/test2/test_app_main.py b/pypy/translator/goal/test2/test_app_main.py
--- a/pypy/translator/goal/test2/test_app_main.py
+++ b/pypy/translator/goal/test2/test_app_main.py
@@ -415,11 +415,14 @@
         child.expect('789')    # expect to see it before the timeout hits
         child.sendline('X')
 
-    def test_options_i_m(self):
+    def test_options_i_m(self, monkeypatch):
         if sys.platform == "win32":
             skip("close_fds is not supported on Windows platforms")
         if not hasattr(runpy, '_run_module_as_main'):
             skip("requires CPython >= 2.6")
+        # make sure that when we do 'import pypy' we get the correct package
+        rootdir = os.path.dirname(autopath.pypydir)
+        monkeypatch.setenv('PYTHONPATH', rootdir)
         p = os.path.join(autopath.this_dir, 'mymodule.py')
         p = os.path.abspath(p)
         child = self.spawn(['-i',


More information about the pypy-commit mailing list