Comment 2 for bug 1283628

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Adding notes from IRC, so I don't lose them. I'm looking at this again, having gotten stuck trying to unwrap decorators from function objects. WIll take another look now.

Notes from IRC:

[15:14:30] <lifeless> done
[16:19:44] <thomi> heh, ok. Thanks :)
[16:20:23] * Channel #subunit created on 2009-09-08 09:58:34 UTC
[18:18:18] <lifeless> thomi: as for impl pointers, i tshould be pretty straight forward
[18:19:08] <thomi> lifeless: I had a quick look - My approach was to store a different attr on the test instance, since I need to keep the scenarios set by the decorator separate from the ones set by the class
[18:19:14] <thomi> err "class attr"
[18:19:53] <lifeless> thomi: so the problem you'll have is that method decorators run at method invocation
[18:20:00] <lifeless> thomi: which is after setUp and tearDown have run
[18:20:12] <thomi> ahh, of course
[18:20:16] <thomi> that's unfortnate
[18:20:26] <thomi> that's kind of terminal, isn't it?
[18:20:41] <lifeless> thomi: so what you actually need to do is change apply_scenario to look for the decorator and DTRT at that stage
[18:21:01] <lifeless> thomi: leaving the decorators actual impl as a no-op pass-through
[18:21:01] <thomi> I see. that'll be interesting :)
[18:21:17] <lifeless> you'll also need to unwrap arbitrary other decorators in principle
[18:21:26] <thomi> haha
[18:21:29] <lifeless> enjoy your dive through function object internals
[18:21:31] <lifeless> :)