Robert Collins added the comment:

I'm going to disagree with michael and antoine here.

The *internals* should be clean and pluggable for sure, but this is actually a 
pretty common thing to try, so there's no reason to force it to only be done by 
external plugins.

Right now the way to plug this in has been complicated by the addition of 
module / class suites, which already perform extra work around individual 
tests, but in a non-introspectable / extensible fashion.

So you could add this as a hook to the loader (decorate each test with some new 
thing) and a CLI option to use that hook for a gc collect call.

Alternatively, we could face down the class/module stuff and rearrange it to be 
extensible (e.g. something along the lines of testresources internals - generic 
groups pre-post stuff) or via some interaction with TestResult.... but I really 
dislike using TestResult to control the run - I have a better layout mostly 
sketched in mind but haven't had time to formalise it.

So I recommend the TestLoader hook point - its well within the current 
responsibilities for it to do this, and I don't see any long term maintenance 
issues.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17908>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to