testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00163
Re: [Merge] lp:~jml/testtools/run-test-improvements into lp:testtools
I've removed 'make_test_runner' and replaced it with a lambda. It was only a separate function to improve clarity of reading.
I've added a comment as you say.
Regarding setting an attribute, unfortunately it's the only thing I can think of that will work with Python 2 and Python 3. Python 3 does not provide any mechanism for getting at the class of an unbound method. Without that, there's nothing to key the information off. You can't use the function itself because it might not be the same function that TestCase.__init__ sees – it depends on decorator order.
If people write decorators "correctly", using functools.wrapper, functools.wraps or twisted.python.util.mergeFunctionMetadata, then the attribute will be passed up the decorator stack properly. I've added a note about this to the docstring.
--
https://code.launchpad.net/~jml/testtools/run-test-improvements/+merge/38659
Your team testtools developers is requested to review the proposed merge of lp:~jml/testtools/run-test-improvements into lp:testtools.
References