Hi all, hi Benjamin, hi Frank (CCed),
i played with Jython2.5.1rc1 and both py.test and
py.execnet more or less work :)
Here is a simple console session opening a connection from
CPython to Jython for executing code dynamically:
http://paste.pocoo.org/show/138497/
This means that one can interact with Java libraries and apps
**from CPython** by firing up a Jython interpreter process and
driving it with the "zero-install" execnet approach. The Jython
interpreter can even be on a different machine :)
py.test also runs on top of Jython but there are some issues with
respect to showing tracebacks, here is a session obtained from execing
jython2.5.1rc1 py/bin/py.test test/code/test_code.py --pastebin=all
--> http://paste.pocoo.org/show/138496/
The py/code directory implements assert re-intepretation and
source retrieval for dynamic code compilation which is e.g.
used by py.test.raises(EXC, 'expression') in order to show
nice tracebacks. Currently i see three major issues:
* jython doesn't lookup AssertionError from the builtins
(i filed http://bugs.jython.org/issue1461)
* dynamic compilation, i.e. py.code.Code().new method:
After adapting it to work with jython by using the
new.code() call i noticed it doesn't preserve the
co_filename object as cpython and pypy do. Maybe it's
anyway better to keep a WeakValueDictionary with
artifical-filename -> code mappings around and deprecate
the new() method hack.
* assert re-interpretation: no clue how this could work yet.
any comments or offers for help welcome.
best,
holger
--
Metaprogramming, Python, Testing: http://tetamap.wordpress.com
Python, PyPy, pytest contracting: http://merlinux.eu
_______________________________________________
py-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/py-dev