Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'concurrent': 0.04; 'happen,': 0.07; 'tests,': 0.07; 'unittest': 0.07; 'bug,': 0.09; 'dependency': 0.09; 'exceeds': 0.09; 'executes': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.12; 'alphabetical': 0.16; 'concurrency,': 0.16; 'otoh,': 0.16; 'rerun': 0.16; 'runner': 0.16; 'wrote:': 0.18; 'reason,': 0.18; 'ryan': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'long.': 0.23; 'defined': 0.24; 'fine': 0.24; 'tests': 0.25; 'testing': 0.26; 'random': 0.28; 'pass': 0.29; 'order.': 0.29; 'fixed': 0.29; 'cases.': 0.30; 'kelly': 0.30; 'observe': 0.30; "didn't": 0.31; 'certainly': 0.32; 'idea': 0.32; 'sort': 0.33; 'header:User- Agent:1': 0.33; 'actually': 0.33; 'header:X-Complaints-To:1': 0.33; 'there': 0.33; 'fri,': 0.34; 'to:addr:python-list': 0.34; 'too': 0.34; 'conflicts': 0.34; 'lie': 0.34; 'test.': 0.34; 'running': 0.35; 'test': 0.35; 'received:au': 0.36; 'subject:with': 0.36; 'convenient': 0.37; 'but': 0.37; 'run': 0.37; 'problems': 0.37; 'received:org': 0.38; 'should': 0.39; "it's": 0.40; 'to:addr:python.org': 0.40; 'more': 0.61; 'order': 0.62; 'results': 0.63; 'thousands': 0.64; 'harder': 0.64; 'success,': 0.64; 'strategy': 0.64; 'cause': 0.67; '2012': 0.67; 'viewing': 0.69; 'benefit': 0.69; 'order,': 0.73; '04:20': 0.84; 'received:110': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lie Ryan Subject: Re: replacing __dict__ with an OrderedDict Date: Sat, 07 Jan 2012 04:42:53 +1100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 110-175-240-90.static.tpgi.com.au User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325871792 news.xs4all.nl 6937 [2001:888:2000:d::a6]:52094 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18611 On 01/07/2012 04:20 AM, Ian Kelly wrote: > On Fri, Jan 6, 2012 at 10:01 AM, Lie Ryan wrote: >> That unittest executes its tests in alphabetical order is implementation >> detail for a very good reason, and good unittest practice dictates that >> execution order should never be defined (some even argued that the execution >> order should be randomized). If the test runner turns out to execute tests >> concurrently, that should not cause problems for a well-designed test. >> Displaying the test results in a more convenient order for viewing is what >> you really wanted in 99.99% of the cases. > > Randomizing the order is not a bad idea, but you also need to be able > to run the tests in a consistent order, from a specific random seed. > In the real world, test conflicts and dependencies do happen, and if > we observe a failure, make a change, rerun the tests and observe > success, we need to be able to be sure that we actually fixed the bug, > and that it didn't pass only because it was run in a different order. > > Concurrent testing is a bad idea for this reason -- it's not > repeatable (testing concurrency, OTOH, is a perfectly fine thing to be > thinking about). Concurrent testing is perfectly fine strategy in the case where you have thousands of tests and running them synchronously will just take too long. Certainly it makes it harder to repeat the test if there is any sort of dependency in the tests, but when you have the large number of tests, the benefit may exceeds the drawbacks.