<div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:13px">That sounds like a great idea, I wonder if anyone's thought of it before.</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">I suggested this in #twisted a few years back and was immediately told it was a bad idea (names withheld!).</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">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.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">T</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 25, 2013 at 9:33 PM, Glyph <span dir="ltr"><<a href="mailto:glyph@twistedmatrix.com" target="_blank">glyph@twistedmatrix.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Jul 25, 2013, at 8:40 AM, Jonathan Lange <<a href="mailto:jml@mumak.net" target="_blank">jml@mumak.net</a>> wrote:</div>
<br><blockquote type="cite"><div style="font-family:Menlo-Regular;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr">On Thu, Jul 25, 2013 at 4:14 PM, Laurens Van Houtven<span> </span><span dir="ltr"><<a href="mailto:_@lvh.io" target="_blank">_@lvh.io</a>></span><span> </span>wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">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...<br>
<br></div></blockquote><div><br></div><div>Why stop there? Why not have a generic system to allow specifying valid return types for any function?</div></div></div></div></div></blockquote><br></div></div></div><div>That sounds like a great idea, I wonder if anyone's thought of it before.</div>
<div><br></div><div>We already encode the information in epytext.  Should we make it a dependency, so it can be parsed at runtime to aid with enforcement?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>
-glyph</div><br></font></span></div><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br></div>