From: <zy...@us...> - 2010-08-14 21:00:25
|
Revision: 7093 http://jython.svn.sourceforge.net/jython/?rev=7093&view=rev Author: zyasoft Date: 2010-08-14 21:00:19 +0000 (Sat, 14 Aug 2010) Log Message: ----------- Removed JSR223TestCase.test_eval, it was causing action at a distance issues in the regrtest. Modified Paths: -------------- trunk/jython/Lib/test/test_jsr223.py Modified: trunk/jython/Lib/test/test_jsr223.py =================================================================== --- trunk/jython/Lib/test/test_jsr223.py 2010-08-14 18:52:58 UTC (rev 7092) +++ trunk/jython/Lib/test/test_jsr223.py 2010-08-14 21:00:19 UTC (rev 7093) @@ -1,30 +1,28 @@ -# test for ScriptEngine, otherwise we are not in Java 6/JSR223 support added +# XXX Earlier version of this test also tested put, get, eval on the +# engine, however this introduced action at a distance where aspects +# of the sys state changed (notably sys.stdin.newlines), which then +# impacted test_univnewlines later in the regrtest. +# +# For now, there may be limits in how much we can test Jython from +# itself, no matter how attractive from an ouroboros perspective that +# may be :). Certainly worth revisiting in 2.6. -# test each feature - -import sys import unittest -from javax.script import ScriptEngine, ScriptEngineManager +import sys from test import test_support +from javax.script import ScriptEngine, ScriptEngineManager class JSR223TestCase(unittest.TestCase): - def setUp(self): - self.engine = ScriptEngineManager().getEngineByName("python") - def test_eval(self): - engine = self.engine - engine.put("a", 42) - engine.eval("b = a/6") - self.assertEqual(engine.get("b"), 7) - def test_factory(self): - f = self.engine.factory + engine = ScriptEngineManager().getEngineByName("python") + f = engine.factory language_version = ".".join(str(comp) for comp in sys.version_info[0:2]) # such as "2.5" impl_version = ".".join(str(comp) for comp in sys.version_info[0:3]) # such as "2.5.2" - self.assertNotEqual(f.scriptEngine, self.engine) # we don't pool engines - + self.assertNotEqual(f.scriptEngine, engine) # we don't pool engines + self.assertEqual(f.engineName, "jython") self.assertEqual(f.engineVersion, impl_version) self.assertEqual(set(f.extensions), set(['py'])) @@ -32,7 +30,7 @@ self.assertEqual(f.languageVersion, language_version) self.assertEqual(set(f.names), set(["python", "jython"])) self.assertEqual(set(f.mimeTypes), set(["text/python", "application/python", "text/x-python", "application/x-python"])) - + # variants self.assertEqual(f.getParameter(ScriptEngine.ENGINE), "jython") self.assertEqual(f.getParameter(ScriptEngine.ENGINE_VERSION), impl_version) @@ -42,8 +40,6 @@ self.assertEqual(f.getOutputStatement("abc"), "print u'abc'") self.assertEqual(f.getProgram("x = 42", "y = 'abc'"), "x = 42\ny = 'abc'\n") - - def test_main(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |