Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107038

Re: How to parameterize unittests

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Michael Selik <michael.selik@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to parameterize unittests
Date Fri, 15 Apr 2016 10:05:28 +0000
Lines 21
Message-ID <mailman.12.1460714740.6324.python-list@python.org> (permalink)
References <570FA466.20003@rece.vub.ac.be> <mailman.106.1460642951.15650.python-list@python.org> <570fb1a3$0$1609$c3e8da3$5496439d@news.astraweb.com> <57108FAC.3020105@rece.vub.ac.be> <CAPTjJmreV+Ed722t7mUUC62L2u8gT-CE5K9ASGon1PHMYFdmTQ@mail.gmail.com> <5710A442.8000906@rece.vub.ac.be> <mailman.5.1460708428.6324.python-list@python.org> <5710affd$0$22140$c3e8da3$5496439d@news.astraweb.com> <CAGgTfkMH5KBqywMdxepN+p2T6FEF9e3DaoaQhL1UQNV79KZRrw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de xb1q2fn1YN31GroeK+vV9QlpKT/U3jtHFtn3K8fCRWgg==
Return-Path <michael.selik@gmail.com>
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; '&gt;&gt;&gt;': 0.15; '-&gt;': 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; '&amp;': 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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAGgTfkMH5KBqywMdxepN+p2T6FEF9e3DaoaQhL1UQNV79KZRrw@mail.gmail.com>
X-Mailman-Original-References <570FA466.20003@rece.vub.ac.be> <mailman.106.1460642951.15650.python-list@python.org> <570fb1a3$0$1609$c3e8da3$5496439d@news.astraweb.com> <57108FAC.3020105@rece.vub.ac.be> <CAPTjJmreV+Ed722t7mUUC62L2u8gT-CE5K9ASGon1PHMYFdmTQ@mail.gmail.com> <5710A442.8000906@rece.vub.ac.be> <mailman.5.1460708428.6324.python-list@python.org> <5710affd$0$22140$c3e8da3$5496439d@news.astraweb.com>
Xref csiph.com comp.lang.python:107038

Show key headers only | View raw


On Fri, Apr 15, 2016, 11:16 AM Steven D'Aprano <steve@pearwood.info> 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.

>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-14 16:08 +0200
  Re: How to parameterize unittests Steven D'Aprano <steve@pearwood.info> - 2016-04-15 01:05 +1000
    Re: How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-15 08:52 +0200
    Re: How to parameterize unittests Chris Angelico <rosuav@gmail.com> - 2016-04-15 17:42 +1000
    Re: How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-15 10:20 +0200
      Re: How to parameterize unittests Steven D'Aprano <steve@pearwood.info> - 2016-04-15 19:10 +1000
        Re: How to parameterize unittests Michael Selik <michael.selik@gmail.com> - 2016-04-15 10:05 +0000
        Re: How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-15 13:43 +0200
        Re: How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-15 14:48 +0200
          Re: How to parameterize unittests Steven D'Aprano <steve@pearwood.info> - 2016-04-16 02:47 +1000
            Re: How to parameterize unittests Chris Angelico <rosuav@gmail.com> - 2016-04-16 03:51 +1000
            Re: How to parameterize unittests Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-04-16 22:37 +0200
    Re: How to parameterize unittests Serhiy Storchaka <storchaka@gmail.com> - 2016-04-15 11:24 +0300
    Re: How to parameterize unittests Chris Angelico <rosuav@gmail.com> - 2016-04-15 18:28 +1000
    Re: How to parameterize unittests Serhiy Storchaka <storchaka@gmail.com> - 2016-04-15 11:31 +0300
    Re: How to parameterize unittests Ben Finney <ben+python@benfinney.id.au> - 2016-04-15 18:35 +1000

csiph-web