Re: [python-tulip] Writing unit tests for user code

2014-07-25 Thread Luca Sbardella
> > > I strongly recommend you reconsider doing this. > > The Twisted core developers have, for several years now, mostly eschewed > the usage of returning Deferreds from test cases. Instead, tests are > written by explicitly controlling all events explicitly, with careful use > of test doubles to

Re: [python-tulip] Writing unit tests for user code

2014-07-25 Thread Tobias Oberstein
And: I'm sure Twisted developer's will have reasons for frowning upon tests returning deferreds, but could you recap shortly why? It has the classic problem with bad tests: reliance on global state which is not controlled by the test. Unit tests should be isolated, they should not affect or rel

Re: [python-tulip] Writing unit tests for user code

2014-07-25 Thread Christopher Armstrong
On July 25, 2014 at 9:08:46 AM, Tobias Oberstein (tobias.oberst...@gmail.com) wrote: >> In Twisted, there is Trial, which provides an extended version of  >> unittest.TestCase with this feature:  >>  >> """  >> The main unique feature of this testing class is the ability to return a  >> ​Deferre

Re: [python-tulip] Writing unit tests for user code

2014-07-25 Thread Tobias Oberstein
In Twisted, there is Trial, which provides an extended version of unittest.TestCase with this feature: """ The main unique feature of this testing class is the ability to return a ​Deferred from a test-case method. A test method which returns a snip I strongly recommend you reconsider doing t

Re: [python-tulip] Re: Writing unit tests for user code

2014-07-25 Thread Tobias Oberstein
Am 25.07.2014 13:21, schrieb Victor Stinner: 2014-07-25 11:30 GMT+02:00 Luca Sbardella : Pulsar has an asynchronous testing framework too http://quantmind.github.io/pulsar/apps/test.html It uses the unittest.TestCase class from the standard library but can handle test functions which return ge

Re: [python-tulip] Writing unit tests for user code

2014-07-25 Thread Christopher Armstrong
On July 22, 2014 at 7:54:17 AM, Tobias Oberstein (tobias.oberst...@gmail.com) wrote: Hi, I am maintaining AutobahnPython, a library that supports Twisted and asyncio/Trollius in one codebase. Now, ideally, I'd like to write unit tests that work across all variants - while avoiding code d

Re: [python-tulip] Re: Writing unit tests for user code

2014-07-25 Thread Victor Stinner
2014-07-25 11:30 GMT+02:00 Luca Sbardella : > Pulsar has an asynchronous testing framework too > > http://quantmind.github.io/pulsar/apps/test.html > > It uses the unittest.TestCase class from the standard library but can handle > test functions which return generators or asyncio/trollius Futures.

[python-tulip] Re: Writing unit tests for user code

2014-07-25 Thread Luca Sbardella
On Tuesday, July 22, 2014 1:54:08 PM UTC+1, Tobias Oberstein wrote: > > Hi, > > I am maintaining AutobahnPython, a library that supports Twisted and > asyncio/Trollius in one codebase. > > Now, ideally, I'd like to write unit tests that work across all variants > - while avoiding code dups. >