##// END OF EJS Templates
Merging -r 1196 from lp:ipython....
Merging -r 1196 from lp:ipython. A couple of issues came up: * Some tests in testing and frontend rely on twisted, but are being tested with nose. This is bad! We currently have hackish logic in iptest to skip these if twisted is not installed, but if it is we are testing them with nose! * Some modules (engineservice, kernel/error, newserialized) have nose skip logic even though they should never be tested with nose. * When trial is run on testStrictDict we get an uncaught error. testStrictDict ... ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (37, 0))

File last commit:

r2053:75628622
r2150:b44b6920 merge
Show More
obj_del.py
34 lines | 1.0 KiB | text/x-python | PythonLexer
"""Test code for https://bugs.launchpad.net/ipython/+bug/239054
WARNING: this script exits IPython! It MUST be run in a subprocess.
When you run the following script from CPython it prints:
__init__ is here
__del__ is here
and creates the __del__.txt file
When you run it from IPython it prints:
__init__ is here
When you exit() or Exit from IPython neothing is printed and no file is created
(the file thing is to make sure __del__ is really never called and not that
just the output is eaten).
Note that if you call %reset in IPython then everything is Ok.
IPython should do the equivalent of %reset and release all the references it
holds before exit. This behavior is important when working with binding objects
that rely on __del__. If the current behavior has some use case then I suggest
to add a configuration option to IPython to control it.
"""
import sys
class A(object):
def __del__(self):
print 'obj_del.py: object A deleted'
a = A()
# Now, we force an exit, the caller will check that the del printout was given
_ip.IP.ask_exit()