[Twisted-Python] Trial & the mock library

Terry Jones terry at jon.es
Fri Jul 26 08:03:33 MDT 2013


> 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 @inlineCallbacks. Trial runs
the test function, gets back a generator object, and thinks "yep, ok,
that's not an error". I've hit that multiple times and know several
experienced Twisted users who have too.

T



On Thu, Jul 25, 2013 at 9:33 PM, Glyph <glyph at twistedmatrix.com> wrote:

>
> On Jul 25, 2013, at 8:40 AM, Jonathan Lange <jml at mumak.net> wrote:
>
> On Thu, Jul 25, 2013 at 4:14 PM, Laurens Van Houtven <_ at lvh.io> wrote:
>
>> In addition to what jml said, I wonder if it makes sense for TestCase to
>> raise when the return value of a test method is something other than None
>> or a Deferred...
>>
>>
> Why stop there? Why not have a generic system to allow specifying valid
> return types for any function?
>
>
> That sounds like a great idea, I wonder if anyone's thought of it before.
>
> We already encode the information in epytext.  Should we make it a
> dependency, so it can be parsed at runtime to aid with enforcement?
>
> -glyph
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130726/b0641e52/attachment.html>


More information about the Twisted-Python mailing list