Trial could produce a warning for tests that return a generator, or pass the generator to defer._inlineCallbacks

[email protected]
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from terrycojones <[email protected]>:

I just added a test to an existing test suite and ran it. It passed, but I was uncomfortable because it seemed to complete too quickly. I changed an assert to its opposite and the test still passed. Hmm...

I realized I was yielding deferreds in the test, but had omitted the @defer.inlineCallbacks decorator. So when trial called my test, it got back a generator and thought it was done.

I think it would be nice if trial detected this and either logged a warning or passed the generator to defer._inlineCallbacks. While doing the latter might be considered overkill, a warning is at least in order.



----------
Type     : enhancement
Component: trial
Keywords : 
Priority : normal
Nosy     : [email protected]
----------
http://twistedmatrix.com/trac/ticket/3917
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.