Differences between revisions 2 and 3
Revision 2 as of 2005-02-20 02:09:26
Size: 2804
Editor: ClarkUpdike
Comment:
Revision 3 as of 2005-02-26 17:28:42
Size: 119
Editor: ClarkUpdike
Comment:
Deletions are marked like this. Additions are marked like this.
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:
{{{
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)
Type "copyright", "credits" or "license" for more information.
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
>>>
}}}

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.

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
>>>
}}}

Is it really running? I'll rename the file test_types.py and try it again.

When I re-run it I get the idential output... so obviously I'm not really running the test.

What gives?
Case solved: I was running using python, not the built jython jar. Silly me.

Running the jython unit tests

Case solved: I was running using python, not the built jython jar. Silly me.

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