Message2966
I have implemented thread-local support on jython.
I have included the py based thread-local
implementation also as in the link
http://wiki.python.org/jython/ThreadLocalVariables.
I have written a testcase file(test_thread_local.py)
based on the test_threading_local.py for testing the
java based thread-local implementation.
Test files:
1) test_thread_local.py
2) test_threading_local.py
The second test case will be failing because the string
representation of thread-local object is not as expected.
And DocTestSuite.addSuite is expecting only one argument. So I commented the two arguments in
test_threading_local.py in the calling place of
addSuite method.
Actually _threading_local.py module is attached with
the doctest and that declares MyLocal, subclass of
local type. There will be a test case expecting the
string "AttributeError: 'MyLocal' object has no
attribute 'color'". But jython gives
<module_name>.MyLocal in place of MyLocal.
<module_name> = __main__ or
= the file name where the class is
declared.
This doctest is used by test_threading_local.py
We may avoid this error by overriding the safeRepr in
PyLocal.java. For py based implementation, we have to step into PyObject.java. I dont think avoiding error is
correct. It might have been implemented for some
purpose. The another way is changing the test case.
Please give me your valuable suggestions/comments.
|
|
Date |
User |
Action |
Args |
2008-02-20 17:18:54 | admin | link | issue1846247 messages |
2008-02-20 17:18:54 | admin | create | |
|