Testsuite crash on python 2.4 due to syntax error

Bug #362458 reported by Jörgen Stenarson
2
Affects Status Importance Assigned to Milestone
IPython
Fix Released
Critical
Brian Granger

Bug Description

There is invalid python 2.4 syntax in the test suite.

SS...........SSSSSSSSSSS.S...S..................E.F..SSSS
======================================================================
ERROR: Failure: SyntaxError ('yield' not allowed in a 'try' block with a 'finally' clause (test_iplib.py, line 64))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\loader.py", line 363, in loadTestsFromName
    module = self.importer.importFromPath(
  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\importer.py", line 84, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "c:\python24\external\ipython\IPython\tests\test_iplib.py", line 64
    yield user_setup, (tmpdir,''), kw
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

======================================================================
FAIL: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\case.py", line 182, in runTest
    self.test(*self.arg)
  File "c:\python24\external\ipython\IPython\tests\test_magic.py", line 86, in test_obj_del
    nt.assert_equals(out,'obj_del.py: object A deleted')
AssertionError: '' != 'obj_del.py: object A deleted'
>> raise self.failureException, \
          (None or '%r != %r' % ('', 'obj_del.py: object A deleted'))

----------------------------------------------------------------------
Ran 53 tests in 0.532s

FAILED (SKIP=19, errors=1, failures=1)

Related branches

Revision history for this message
Jörgen Stenarson (jorgen-stenarson) wrote :
Download full text (3.5 KiB)

On another computer with nose 0.11-dev I got a slightly different behaviour on this bug. The second Failure on __del__ methods only occured when printing something in ipy_user_conf.py

Python 2.4 incompatibilty

C:\python\external\ipython\IPython\tests>python ..\..\scripts\iptest
SS...........SSSSSSSSSSS.S...S..................E......SSS
======================================================================
ERROR: Failure: SyntaxError ('yield' not allowed in a 'try' block with a 'finally' clause (test_ipli
b.py, line 64))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\loader.py", line 363, in loa
dTestsFromName
    module = self.importer.importFromPath(
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\importer.py", line 39, in im
portFromPath
    return self.importFromDir(dir_path, fqname)
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\importer.py", line 84, in im
portFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "c:\python\external\ipython\IPython\tests\test_iplib.py", line 64
    yield user_setup, (tmpdir,''), kw
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

----------------------------------------------------------------------
Ran 55 tests in 4.189s

FAILED (SKIP=18, errors=1)

Traceback when printing something in ipy_user_conf

C:\python\external\ipython\IPython\tests>python ..\..\scripts\iptest
printed in ipy_user_conf
SS...........SSSSSSSSSSS.S...S..................E.F....SSS
======================================================================
ERROR: Failure: SyntaxError ('yield' not allowed in a 'try' block with a 'finally' clause (test_ipli
b.py, line 64))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\loader.py", line 363, in loa
dTestsFromName
    module = self.importer.importFromPath(
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\importer.py", line 39, in im
portFromPath
    return self.importFromDir(dir_path, fqname)
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\importer.py", line 84, in im
portFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "c:\python\external\ipython\IPython\tests\test_iplib.py", line 64
    yield user_setup, (tmpdir,''), kw
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

======================================================================
FAIL: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python24\lib\site-packages\nose-0.11.0.dev_r0-py2.4.egg\nose\case.py", line 182, in runTe
st
    self.test(*self.arg)
  File "c:\python\external\ipython\IPython\tests\test_magic.py", line 86, in test_obj_del
    nt.assert_equals(out,'obj_del.py: object A deleted')
AssertionError: 'printed in ipy_user_conf\nobj_del.py: object A deleted'...

Read more...

Changed in ipython:
importance: Undecided → Critical
milestone: none → 0.10
status: New → Confirmed
Revision history for this message
Brian Granger (ellisonbg) wrote :

Could someone on Python 2.4 try my bugfixes0411409 branch and make sure this is gone?

Thanks,

Brian

Changed in ipython:
assignee: nobody → ellisonbg
status: Confirmed → Fix Committed
Revision history for this message
Brian Granger (ellisonbg) wrote :

The second part of this one in test_magic still needs to be fixed.

Changed in ipython:
status: Fix Committed → In Progress
Revision history for this message
Jörgen Stenarson (jorgen-stenarson) wrote : Re: [Bug 362458] Re: Testsuite crash on python 2.4 due to syntax error

Brian Granger skrev:
> Could someone on Python 2.4 try my bugfixes0411409 branch and make sure
> this is gone?
>
The syntax error bug is fixed but the obj_del bug is still there.
There are test failures due to a missing module twisted.trial. I have
not installed twisted.

Attached is a log from my test.

/Jörgen

Revision history for this message
Brian Granger (ellisonbg) wrote : Re: [Bug 362458] Re: Testsuite crash on python 2.4 due to syntax error
Download full text (3.2 KiB)

The import error due to twisted being missing is just fine. We are
working on a better way of running the test suite that will skip the
twisted requiring tests when twisted is missing.

I don't know what is going on with the obj_del issue. The script is
returning an empty string on python 2.4 for some reason. I will
probably have the install 2.4 and look at this.

Brian

On Thu, Apr 23, 2009 at 10:31 AM, Jörgen Stenarson
<email address hidden> wrote:
> Brian Granger skrev:
>> Could someone on Python 2.4 try my bugfixes0411409 branch and make sure
>> this is gone?
>>
> The syntax error bug is fixed but the obj_del bug is still there.
> There are test failures due to a missing module twisted.trial. I have
> not installed twisted.
>
> Attached is a log from my test.
>
> /Jörgen
>
>
> ** Attachment added: "log.txt"
>   http://launchpadlibrarian.net/25896150/log.txt
>
> --
> Testsuite crash on python 2.4 due to syntax error
> https://bugs.launchpad.net/bugs/362458
> You received this bug notification because you are a member of IPython
> Developers, which is subscribed to IPython.
>
> Status in IPython - Enhanced Interactive Python: In Progress
>
> Bug description:
> There is invalid python 2.4 syntax in the test suite.
>
>
>
> SS...........SSSSSSSSSSS.S...S..................E.F..SSSS
> ======================================================================
> ERROR: Failure: SyntaxError ('yield' not allowed in a 'try' block with a 'finally' clause (test_iplib.py, line 64))
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\loader.py", line 363, in loadTestsFromName
>    module = self.importer.importFromPath(
>  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\importer.py", line 39, in importFromPath
>    return self.importFromDir(dir_path, fqname)
>  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\importer.py", line 84, in importFromDir
>    mod = load_module(part_fqname, fh, filename, desc)
>  File "c:\python24\external\ipython\IPython\tests\test_iplib.py", line 64
>    yield user_setup, (tmpdir,''), kw
> SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause
>
> ======================================================================
> FAIL: Test that object's __del__ methods are called on exit.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "c:\python24\lib\site-packages\nose-0.10.4-py2.4.egg\nose\case.py", line 182, in runTest
>    self.test(*self.arg)
>  File "c:\python24\external\ipython\IPython\tests\test_magic.py", line 86, in test_obj_del
>    nt.assert_equals(out,'obj_del.py: object A deleted')
> AssertionError: '' != 'obj_del.py: object A deleted'
>>>  raise self.failureException, \
>          (None or '%r != %r' % ('', 'obj_del.py: object A deleted'))
>
>
> ----------------------------------------------------------------------
> Ran 53 tests in 0.532s
>
> FAILED (SKIP=19, errors=1, failures=1)
>

--
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San L...

Read more...

Revision history for this message
Brian Granger (ellisonbg) wrote :

Starting separate bug report for the second part of this (obj_del.py)

Changed in ipython:
status: In Progress → Fix Committed
Changed in ipython:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.