[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-08 Thread Brian White
Brian White added the comment: I am somewhat new to mock objects. I'm coding up my first one now (in D) to simulate a "stream" for other objects I want to write. Even within a single module, I typically have many tests for the methods within that module. And since a module's methods make use o

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-06 Thread Steve Purcell
Steve Purcell added the comment: Hi Brian - thanks for going into some details of your rationale! You might be surprised to hear that it's indeed possible to make all of your unit tests mutually independent; check out the area of 'mock objects'. It turns out to be possible, and indeed desirab

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-06 Thread Brian White
Brian White added the comment: Having tests run independently of each other is not the same as having tests be completely independent. I'd argue that the latter is impossible. You're never going to test the entire system in a single test case and thus the tests work together (i.e. not independe

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-06 Thread Steve Purcell
Steve Purcell added the comment: I guess I don't completely agree with the rationale, because I've never wanted this feature; when running tests en-masse after refactoring, I want an overview of what was broken. If the codebase is in good shape, the test failures will be few and close togethe

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Actually, py.test and nose both have the -x option for this purpose. I use it very often during development, mostly during a refactoring phase: failures are easy to correct, and I don't want to wait for the complete suite to complete and display tons of tra

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-06 Thread Steve Purcell
Steve Purcell added the comment: Hi Brian; The module is intended for test suites where the unit tests are written to be independent of each other, which is the "standard" way to do things. Note, for instance, that there is no convenient support for changing the order in which tests run. W

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-05 Thread Benjamin Peterson
Changes by Benjamin Peterson: -- nosy: +purcell __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue2241] Additional Flag For Unit-Test Module: There Can Be Only One (Error)

2008-03-05 Thread Brian White
New submission from Brian White: The attached diff adds a "-o" ("--one") option to the "unittest" module that causes the run to abort on the first error encountered. I name my tests so that the lowest-level tests get run first so stopping at the first error tends to prevent a lot of dependent er