Closed GoogleCodeExporter closed 9 years ago
What would mock do as a class decorator?
Original comment by fuzzyman
on 10 Jun 2010 at 9:55
it would wrap every test method in a testcase
Original comment by kon...@gmail.com
on 10 Jun 2010 at 11:09
Wrap every test method in a testcase? Eh? (In unittest all test methods become
separate TestCase instances anyway.) What does that have to do with mock?
Do you mean patch as a class decorator, automatically wrapping a patch
decorator round every test method instead of having to decorate them separately?
Original comment by fuzzyman
on 10 Jun 2010 at 11:18
Original comment by fuzzyman
on 10 Jun 2010 at 11:19
> Do you mean patch as a class decorator, automatically wrapping a patch
decorator round every test method instead of having to decorate them separately?
Exactly :)
Original comment by kon...@gmail.com
on 10 Jun 2010 at 11:22
Right - so given your comment on issue 30 I think what you mean is to allow
patch to work as a class decorator; the equivalent of patching every test
method. That sounds like a good feature. Again, I would be open to patches
(with tests and docs).
Want to help me maintain mock? There are lots of open issues here you could
comment on...
Original comment by fuzzyman
on 10 Jun 2010 at 11:24
Sure, I'll get to it this evening.
Original comment by kon...@gmail.com
on 10 Jun 2010 at 11:57
Original comment by fuzzyman
on 12 Jun 2010 at 10:58
Test methods are unfortunately identified by the TestLoader.testMethodPrefix
attribute. That means from a TestCase class you can't *tell* which methods will
later be used as tests.
For initial implementation we could recognise test methods as ones that start
with 'test'. Maybe consider making it configurable as a feature request for
future releases.
Original comment by fuzzyman
on 12 Jun 2010 at 11:03
Original comment by fuzzyman
on 12 Jun 2010 at 11:22
Original comment by kon...@gmail.com
on 12 Jun 2010 at 12:49
Original issue reported on code.google.com by
kon...@gmail.com
on 10 Jun 2010 at 9:51