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


Groups > comp.lang.python > #107067

Re: How to parameterize unittests

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to parameterize unittests
Date Sat, 16 Apr 2016 03:51:17 +1000
Lines 11
Message-ID <mailman.31.1460742680.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> <5710D3DA.6030005@rece.vub.ac.be> <5710E30B.6050304@rece.vub.ac.be> <mailman.22.1460724628.6324.python-list@python.org> <57111b0b$0$1606$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmonQX0s+cbFsDKr=osHQNp8GKJaCrVfuGfTjzXYsjJqZQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de ZeRD3UNR09uagyJgwQoBmQbWpizjAjM1mg7SqWWXi81Q==
Return-Path <rosuav@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; '16,': 0.03; 'classes,': 0.05; 'correct.': 0.07; 'api': 0.09; 'cc:addr:python-list': 0.09; 'subject:How': 0.09; 'subclasses': 0.09; '2016': 0.16; '2:47': 0.16; 'behaviour.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "module's": 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'refactoring': 0.16; 'wrote:': 0.16; 'tree': 0.18; 'tests': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'sat,': 0.23; 'header:In- Reply-To:1': 0.24; 'sense': 0.26; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'classes': 0.30; 'code': 0.30; 'point': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'sure': 0.39; 'your': 0.60; 'different': 0.63; 'offer': 0.66; 'chrisa': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=tr/SOXhuSNfs63YPuMGBJrY0JZq8mxce0wS3y1jy0r8=; b=Jmcx4GOTcfL/3V4DiIilZ+ACR+iOORMNHlvnxsHw3c6lC8AY1FheIbPF0uoMWP6Ndo gWobM5mn4tTJSgizyEre3Nk92bfKfyHF2khpsISWxFx6cE4y+yHJj15kwrWNkGpet/au T6YgL3E5F3WSejxQHCty8UmhoMuwas5LnrcvglaaFkpKiSI3LwcoXwHVYFyc/afh8VRQ XhSInZtPNICTUbKnt5hcC2VHeUlD1LnYJ/jgKdiMNgT9/mP3q1a8LTgwTJxX7bh5GQ1I 8IWSngZ+YsNsHZcj3vP5g/6sS703hhQV8t5j9UXu/y/954tNO+a0SqhHxDK6dtBBLuvT /RSg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=tr/SOXhuSNfs63YPuMGBJrY0JZq8mxce0wS3y1jy0r8=; b=KYHNAkgM1XIqBIP7tdSqVO9GvGqXy4shNyuXCOy8GXpU6SmJl2z28QtHYWaEH4EZ+4 rOdDwyhHp6GPKBnUtanCTzrDseGNtkUD3pglMiep3OJJCYg8RB2+HdRtheLfnPD19Abu qaEu8I8Ay3QHGNa+KKuiSzmJZ5G3f8aKi2D6OOyLibP12u/SjHhHU2YbOgn5FUVydzBL KTPfmLQHvZQ3uisy77z5CBil/Ubtj9dS7T6wxaqGvhM/GU1GxnrYuFwype7NFVLt3A2Z OUxBPFU7mD2AyQ/bQ0OyaNij/36OqgNNo22NPPv691BuYHpaTmnmHUtfx39LbibBr83t Qovg==
X-Gm-Message-State AOPr4FUHT7UCjweCy1uyHMbIUKAdmrl9NocnKqvquyiq4sz3rVQHAvgj5I2krg/OwzEwVsgT4Ak6Va0aYTeFlA==
X-Received by 10.50.23.80 with SMTP id k16mr6622099igf.94.1460742677247; Fri, 15 Apr 2016 10:51:17 -0700 (PDT)
In-Reply-To <57111b0b$0$1606$c3e8da3$5496439d@news.astraweb.com>
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 <CAPTjJmonQX0s+cbFsDKr=osHQNp8GKJaCrVfuGfTjzXYsjJqZQ@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> <5710D3DA.6030005@rece.vub.ac.be> <5710E30B.6050304@rece.vub.ac.be> <mailman.22.1460724628.6324.python-list@python.org> <57111b0b$0$1606$c3e8da3$5496439d@news.astraweb.com>
Xref csiph.com comp.lang.python:107067

Show key headers only | View raw


On Sat, Apr 16, 2016 at 2:47 AM, Steven D'Aprano <steve@pearwood.info> wrote:
> If the tests for your AVL tree and it's subclasses are *identical*, then
> what's the point of the subclasses?

If the tree classes all have the same API but different performance
trade-offs, it would make sense to use all the same tests to make sure
their behaviours are correct. But if your module's purpose is to offer
a variety of tree classes, its tests should be designed around
parameterization. Refactoring the code would be the correct behaviour.

ChrisA

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