Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'classes,': 0.05; 'suddenly': 0.07; 'file)': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'run,': 0.09; '~ethan~': 0.09; 'windows': 0.15; 'called,': 0.16; 'sudo': 0.16; 'apps': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'seems': 0.21; 'tests': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply- To:1': 0.27; "i'm": 0.30; 'getting': 0.31; 'occurs': 0.31; 'class': 0.32; 'summary': 0.32; 'run': 0.32; 'running': 0.33; 'anybody': 0.35; 'test': 0.35; 'but': 0.35; 'done': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'unit': 0.37; 'two': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'skip:u 10': 0.60; 'received:173': 0.61; 'finally': 0.65; 'behavior': 0.77; 'ethan': 0.84; 'exercised': 0.84; 'fails,': 0.84; 'furman': 0.84; 'routines': 0.84; 'killed': 0.91 Date: Wed, 30 Apr 2014 16:32:46 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: unittest weirdness References: <531F78E9.5020103@stoneleaf.us> In-Reply-To: <531F78E9.5020103@stoneleaf.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Exim-ID: 1Wfdzb-0004z3-FS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:50381 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 5 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1398902205 news.xs4all.nl 2943 [2001:888:2000:d::a6]:41236 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70792 On 03/11/2014 01:58 PM, Ethan Furman wrote: > > So I finally got enough data and enough of an understanding to write some unit tests for my code. > The weird behavior I'm getting: > > - when a test fails, I get the E or F, but no summary at the end > (if the failure occurs in setUpClass before my tested routines > are actually called, I get the summary; if I run a test method > individually I get the summary) > > - I have two classes, but only one is being exercised > > - occasionally, one of my gvim windows is unceremoniously killed > (survived only by its swap file) > > I'm running the tests under sudo as the routines expect to be run that way. > > Anybody have any ideas? For posterity's sake: I added a .close() method to the class being tested which destroys its big data structures; then I added a tearDownClass method to the unittest. That seems to have done the trick with getting the tests to /all/ run, and by apps don't suddenly disappear. :) -- ~Ethan~