New submission from Brian Lauber:

I wrote a module that registers an "atexit" handler.  However, when I executed 
the unit tests for this module via setuptools, the "atexit" handler would never 
be invoked:

      python ./setup.py test

The root cause of the issue is that fact that setuptool's "test" command 
un-loads modules between each test run.  This means that the 'atexit' module is 
unavailable when Python exits, which means that the callbacks are never invoked.

It is possible to prevent setuptools from un-loading the 'atexit' module by 
importing 'atexit' at the beginning of the setup.py file.  This allows the 
'atexit' handlers to run, but they ultimately fail because all of the modules 
have already been unloaded.

You can find a more complete write-up on the issue here:

https://briandamaged.org/blog/?p=1181

----------
messages: 701
nosy: Brian.Lauber
priority: bug
status: unread
title: "test" command breaks 'atexit' handlers

_______________________________________________
Setuptools tracker <[email protected]>
<http://bugs.python.org/setuptools/issue147>
_______________________________________________
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to