[pypy-svn] r35055 - pypy/dist/pypy/lang/js/test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Nov 27 21:03:47 CET 2006


Author: cfbolz
Date: Mon Nov 27 21:03:46 2006
New Revision: 35055

Modified:
   pypy/dist/pypy/lang/js/test/test_interp.py
   pypy/dist/pypy/lang/js/test/test_parser.py
Log:
skip js tests if the javascript interpreter (which is used to parse js
currently) is not found.


Modified: pypy/dist/pypy/lang/js/test/test_interp.py
==============================================================================
--- pypy/dist/pypy/lang/js/test/test_interp.py	(original)
+++ pypy/dist/pypy/lang/js/test/test_interp.py	Mon Nov 27 21:03:46 2006
@@ -13,6 +13,17 @@
 def parse_d(code):
     return build_interpreter(parse(code))
 
+def js_is_on_path():
+    try:
+        py.path.local.sysfind("js")
+    except py.error.ENOENT: 
+        return False 
+    return True
+
+if not js_is_on_path():
+    py.test.skip("js binary not found")
+
+
 class TestInterp(object):
     def test_simple(self):
         assert Plus(Number(3), Number(4)).call().floatval == 7

Modified: pypy/dist/pypy/lang/js/test/test_parser.py
==============================================================================
--- pypy/dist/pypy/lang/js/test/test_parser.py	(original)
+++ pypy/dist/pypy/lang/js/test/test_parser.py	Mon Nov 27 21:03:46 2006
@@ -1,6 +1,12 @@
 from pypy.lang.js.parser import read_js_output, JsSyntaxError, parse
+from pypy.lang.js.test.test_interp import js_is_on_path
 import py
 
+
+if not js_is_on_path():
+    py.test.skip("js binary not found")
+
+
 def test_read_js_output():
     assert read_js_output("1+1").find("PLUS") > -1
     assert read_js_output("""



More information about the Pypy-commit mailing list