Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2005-02-19 14:35:03
Size: 2805
Editor: ClarkUpdike
Comment:
Revision 6 as of 2008-11-15 09:16:03
Size: 3043
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Running the jython unit tests == === IOError When Pasting Code Into Console ===
Line 3: Line 3:
I've been trying to run the jython unit tests, but I'm having problems. I followed the directions these directions: /JythonDeveloperGuide, but it seems like it only runs the Python 2.2 unit tests: ==== March 01, 2005 Update ====

It seems to be related to running from the jar as opposed to the class directories.

==== Feb 28, 2005 ====
Using the latest build, I'm getting IOError's when I try to paste multiple lines of code into the console.

Here it is working in the 2.1 console:
Line 5: Line 12:
C:\workspace\jythonNSC\Lib\test>python regrtest.py -a
test_MimeWriter
test_StringIO
test___all__
test___future__
test_al
test_al skipped -- No module named al
test_array
test_asynchat
...
}}}

Ok, well maybe I just needed to run it via jython:
{{{
C:\workspace\jythonNSC\Lib\test>jython regrtest.py
Traceback (innermost last):
  File "regrtest.py", line 1010, in ?
  File "regrtest.py", line 340, in main
  File "regrtest.py", line 98, in findalltests
  File "regrtest.py", line 475, in findtests
AttributeError: class 'org.python.modules.os' has no attribute 'extsep'
}}}

Hmmm. Maybe I can run the tests using jython interactively:
{{{
Jython 2.1 on java1.3.1_01 (JIT: null)
C:\WINDOWS\SYSTEM32>jython_142
Jython 2.1 on java1.4.2 (JIT: null)
Line 32: Line 15:
import sys
sys.path.append("/workspace/jythonNSC/Lib/test/")
execfile("/workspace/jythonNSC/Lib/test/regrtest.py")
}}}

...and the window just closes. Okay, it's probably raising a sys.exit(). I'll catch it to see what's going on.
{{{
Jython 2.1 on java1.3.1_01 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> from traceback import print_exc
>>> sys.path.append("/workspace/jythonNSC/Lib/test/")
>>> try:
... execfile("/workspace/jythonNSC/Lib/test/regrtest.py")
... except:
... print_exc()
...
Traceback (most recent call last):
  File "/workspace/jythonNSC/Lib/test/regrtest.py", line 1010, in ?
    main()
  File "/workspace/jythonNSC/Lib/test/regrtest.py", line 448, in main
    sys.exit(len(bad) > 0)
SystemExit: 0
>>> # 1 ##############################################################################################
>>> # 2 ##############################################################################################
>>> # 3 ##############################################################################################
>>> # 4 ##############################################################################################
>>> # 5 ##############################################################################################
>>> # 6 ##############################################################################################
>>> # 7 ##############################################################################################
>>> # 8 ##############################################################################################
>>> # 9 ##############################################################################################
>>>
Line 58: Line 28:
It seems like it ran okay, but I didn't get any output. But I didn't specify "quiet mode" and I would have expected some output. Is anything really running. I'll try some other ways. Here is the same thing broken in the 2.2a console:
{{{
C:\Documents and Settings\updikca1>jytip
Jython 2.2a1 on java1.4.1_03 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> # 1 ##############################################################################################
Traceback (innermost last):
  (no code object) at line 0
IOError: Not enough storage is available to process this command
Line 60: Line 38:
Can I run an individual test the same way? I'll try running `test_types` manually:
{{{
Jython 2.1 on java1.3.1_01 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from traceback import print_exc
>>> import sys
>>> sys.path.append("/workspace/jythonNSC/Lib/test/")
>>> from regrtest import main
>>> try:
... main("test_types","/workspace/jythonNSC/Lib/test/")
... except:
... print_exc()
...
Traceback (most recent call last):
  File "C:\workspace\jythonNSC\Lib\test\regrtest.py", line 448, in main
    sys.exit(len(bad) > 0)
SystemExit: 0
>>>
C:\Documents and Settings\updikca1># 2 #################################################################################
#############
'#' is not recognized as an internal or external command,
<snip>
Line 80: Line 44:
Is it really running? I'll rename the file test_types.py and try it again. It's not entirely deterministic, but this case will work:
{{{# 1 ##############################################################################################
# 2 ##############################################################################################
# 3 ##############################################################################################
# 4 ##############################################################################################
# 5 ##############################################################################################
# 6 ##############################################################################################
# 7 ##############################################################################################
# 8 #############################################################################}}}
Line 82: Line 54:
When I re-run it I get the idential output... so obviously I'm not really running the test. But adding one additional char will break it (at least for me).
Line 84: Line 56:
What gives? Does anyone else experience this?

IOError When Pasting Code Into Console

March 01, 2005 Update

It seems to be related to running from the jar as opposed to the class directories.

Feb 28, 2005

Using the latest build, I'm getting IOError's when I try to paste multiple lines of code into the console.

Here it is working in the 2.1 console:

C:\WINDOWS\SYSTEM32>jython_142
Jython 2.1 on java1.4.2 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> # 1 ##############################################################################################
>>> # 2 ##############################################################################################
>>> # 3 ##############################################################################################
>>> # 4 ##############################################################################################
>>> # 5 ##############################################################################################
>>> # 6 ##############################################################################################
>>> # 7 ##############################################################################################
>>> # 8 ##############################################################################################
>>> # 9 ##############################################################################################
>>>
>>>

Here is the same thing broken in the 2.2a console:

C:\Documents and Settings\updikca1>jytip
Jython 2.2a1 on java1.4.1_03 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> # 1 ##############################################################################################
Traceback (innermost last):
  (no code object) at line 0
IOError: Not enough storage is available to process this command

C:\Documents and Settings\updikca1># 2 #################################################################################
#############
'#' is not recognized as an internal or external command,
<snip>

It's not entirely deterministic, but this case will work: {{{# 1 ############################################################################################## # 2 ############################################################################################## # 3 ############################################################################################## # 4 ############################################################################################## # 5 ############################################################################################## # 6 ############################################################################################## # 7 ############################################################################################## # 8 #############################################################################}}}

But adding one additional char will break it (at least for me).

Does anyone else experience this?

ClarkUpdike/ScrapBook (last edited 2008-11-15 09:16:03 by localhost)