Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Selik Newsgroups: comp.lang.python Subject: Re: How to parameterize unittests Date: Fri, 15 Apr 2016 10:05:28 +0000 Lines: 21 Message-ID: References: <570FA466.20003@rece.vub.ac.be> <570fb1a3$0$1609$c3e8da3$5496439d@news.astraweb.com> <57108FAC.3020105@rece.vub.ac.be> <5710A442.8000906@rece.vub.ac.be> <5710affd$0$22140$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de xb1q2fn1YN31GroeK+vV9QlpKT/U3jtHFtn3K8fCRWgg== 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; 'anyway.': 0.04; 'context': 0.05; 'lines,': 0.05; 'trailing': 0.07; 'subject:How': 0.09; 'imports': 0.09; 'obligated': 0.09; '>>>': 0.15; '->': 0.16; '2016': 0.16; 'assignments': 0.16; 'attribute,': 0.16; 'editor,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'replaced.': 0.16; 'to:addr:pearwood.info': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.16; 'obviously': 0.16; "wouldn't": 0.16; '>>>': 0.20; 'to:2**1': 0.21; 'ignored.': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'helpful': 0.27; 'error': 0.27; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'see,': 0.27; 'inspect': 0.29; 'other,': 0.29; '15,': 0.30; 'probably': 0.31; 'run': 0.33; 'class': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'changing': 0.34; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'replace': 0.35; 'received:74.125.82': 0.35; 'but': 0.36; 'should': 0.36; '(3)': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'skip:& 10': 0.37; 'aspects': 0.37; 'rather': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'your': 0.60; 'avoid': 0.61; '&': 0.61; 'cut': 0.67; 'trial': 0.81; 'pardon': 0.84; 'try,': 0.84; 'visually': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=yDdV5ppa6TDCaJG+ZOkHwYZ3HelfCz6uO36ppD0Ugkg=; b=WfjZ261kLYySanvZhbxjjIcDGmajUE9cx6Jhq8WSLQrd33UwdS8No2B6mByY5lZXkv 0MR2G2+Zdi3A3bwg6KwDa+ShnXoSEXwe+bX19s2CEl49ya6S5cT/Mi9cfxp5s7MszVrz LUKVSLvQdPpmInxoEoiPiyfJODZj6O+YVGWR4qwtQFXH4SYVYs+goILF83nkaYbWN41p 6qPkqpxS0ljcEFWeqy2b47Xcrs/fvZplXOJBe17U2NY3MteKf+p5NEyhdwmVifzSeQ5G S+yckUy6FHn82ju5+BdJykYRKNUYLMg8sCj+VjEtADiFpP+lXW8uyzeS3Pu6tRKfoma3 lCAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=yDdV5ppa6TDCaJG+ZOkHwYZ3HelfCz6uO36ppD0Ugkg=; b=BP9WxZ58ijeMvObH0Pt8iwxgPEmrfj+D9iJW0mEvl9xfJb9FOaRQsCD2GhjjtR9HJL KwJfoL2Sg+1kjfurpg97cFIMZ45ktFtqaB5RUNY+9dr+9klQ37V+eP92FTMCzR5lqPyz KQkdgXwXJuhLakxYngYddCzu1eBxuCUeGu81hnXkQsobmXF5/05R/nX+yKViuTZn2PIK Tt3yMcqRPwF43zDv/rXMmzFsYczKilrIi/NTgta845FUbUrbz9yzGbYy4Yd3uODuBn6L EmZW0MISSK/AxxVvbEv03AV89l2GvvhunUJbbXD/oCndgLf5V3ZsBq4E+r/5QSPmcHp9 LdQw== X-Gm-Message-State: AOPr4FUZZgUIwnSpIRH/0ffJ/fBdYFZ/iTg+WsX/N0TQtsDEY32J6RtAd+QaK0qiSfEqzStxsOWnLntp5op96Q== X-Received: by 10.194.184.38 with SMTP id er6mr20114954wjc.93.1460714738203; Fri, 15 Apr 2016 03:05:38 -0700 (PDT) In-Reply-To: <5710affd$0$22140$c3e8da3$5496439d@news.astraweb.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <570FA466.20003@rece.vub.ac.be> <570fb1a3$0$1609$c3e8da3$5496439d@news.astraweb.com> <57108FAC.3020105@rece.vub.ac.be> <5710A442.8000906@rece.vub.ac.be> <5710affd$0$22140$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:107038 On Fri, Apr 15, 2016, 11:16 AM Steven D'Aprano wrote: > On Fri, 15 Apr 2016 06:20 pm, Antoon Pardon wrote: > > >>> I see, that's going to be a lot of cut & pastes. > > (3) In your editor, run a global Find and Replace "avltree -> self.tree". > You will need to inspect each one rather than do it automatically. > Obviously you need to avoid changing the "tree = avltree" class attribute, > and any import lines, but probably everything else should change. > There's probably some context around uses of avltree that should be replaced. Perhaps a trailing dot: "avltree." replace with "self.tree." so imports and assignments are ignored. Also, your other, very helpful steps should minimize the trial and error aspects of global find-replace. I wouldn't feel obligated to visually inspect each one -- not on my first try, anyway. >