classification
Title: optparse tests fail under Jython
Type: feature request Stage:
Components: Library (Lib) Versions: Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: gward Nosy List: ajaksu2, akuchling, drtimcouper, gward, pjenvey (5)
Priority: normal Keywords: easy, patch

Created on 2007-04-20 16:50 by drtimcouper, last changed 2009-06-02 00:45 by pjenvey.

Files
File name Uploaded Description Edit Remove
test_optparse.patch drtimcouper, 2007-04-20 16:50 test_optparse.py mod. for jython
Messages (5)
msg52484 - (view) Author: Tim Couper (drtimcouper) Date: 2007-04-20 16:50
Extension of test code for jython
msg59774 - (view) Author: A.M. Kuchling (akuchling) Date: 2008-01-12 01:47
The patch would need to be checked against Jython's last release and/or
the current trunk.
msg87791 - (view) Author: Daniel Diniz (ajaksu2) Date: 2009-05-15 02:12
Can someone ping the Jython tracker for help on this?
msg88695 - (view) Author: Greg Ward (gward) Date: 2009-06-02 00:17
I just took a look at the original patch uploaded by drtimcouper.  IMHO
it would be cleaner and simpler to modify optparse.py so that it behaves
as consistently as possible under Jython and CPython.  For example,
optparse should catch the ValueError raised when a user supplies a bad
integer input and raise a new exception with a consistent error message.
 That sort of thing.

drtimcouper: if you're still out there and reading this, would you mind
submitting a new patch?
msg88698 - (view) Author: Philip Jenvey (pjenvey) Date: 2009-06-02 00:45
This looks like it was against Jython 2.2? Jython 2.5 passes 2.5's 
test_optparse with only fixing __builtins__ and disabling the weakref test

So uses of __builtins__ should should be importing __builtin__ and use 
that instead. sys.platform.startswith('java') should be 
test_support.is_jython instead. And on 2.6/3.2 you can now decorate 
test_refleak with @test_support.impl_check('Relies on sys.getrefcount', 
cpython=True) to skip it
History
Date User Action Args
2009-06-02 00:45:57pjenveysetnosy: + pjenvey
messages: + msg88698
2009-06-02 00:18:01gwardsetnosy: akuchling, gward, ajaksu2, drtimcouper
components: + Library (Lib), - Tests
title: test_optparse.py mod. for jython -> optparse tests fail under Jython
2009-06-02 00:17:18gwardsetmessages: + msg88695
2009-05-15 02:12:26ajaksu2setversions: + Python 2.7, Python 3.2, - Python 2.6
nosy: + ajaksu2

messages: + msg87791

type: feature request
2008-01-12 01:47:54akuchlingsetkeywords: + easy
nosy: + akuchling
messages: + msg59774
2007-04-20 16:50:54drtimcoupercreate