Re: [Twisted-Python] Trial & the mock library

2013-07-26 Thread Jonathan Lange
On Fri, Jul 26, 2013 at 12:12 AM, Glyph wrote: > > On Jul 25, 2013, at 3:51 PM, exar...@twistedmatrix.com wrote: > > On 08:33 pm, gl...@twistedmatrix.com wrote: > > > On Jul 25, 2013, at 8:40 AM, Jonathan Lange wrote: > > On Thu, Jul 25, 2013 at 4:14 PM, Laurens Van Houtven <_...@lvh.io> wrote:

Re: [Twisted-Python] Trial & the mock library

2013-07-26 Thread Glyph
On Jul 25, 2013, at 6:51 PM, Matt Haggard wrote: > I have a few thoughts: > > First, how does this hypothetical system for specifying return types solve > the original problem (that user-written methods on TestCase pass unexpectedly > when a non-Deferred is returned)? If I'm the one writing

Re: [Twisted-Python] Trial & the mock library

2013-07-26 Thread Terry Jones
> That sounds like a great idea, I wonder if anyone's thought of it before. I suggested this in #twisted a few years back and was immediately told it was a bad idea (names withheld!). Another case in which this pops up is if you accidentally yield some deferreds in a test but don't decorate with

Re: [Twisted-Python] Trial & the mock library

2013-07-26 Thread exarkun
On 25 Jul, 02:25 pm, jamesbroadh...@gmail.com wrote: Hey all - I've recently started working with the 'mock' library in our trial tests, and am looking for some best-practice advice. I'm really just starting to get used to the library, so it might well have functionality that I'm unaware of

Re: [Twisted-Python] Trial & the mock library

2013-07-26 Thread Glyph
On Jul 26, 2013, at 7:12 AM, exar...@twistedmatrix.com wrote: > To address this problem, I suggest you get into the habit of watching your > unit tests fail in the expected way before you make the necessary > implementation changes to make them pass. > > This is only one of an unlimited number