Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: How to parameterize unittests Date: Sat, 16 Apr 2016 03:51:17 +1000 Lines: 11 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> <5710D3DA.6030005@rece.vub.ac.be> <5710E30B.6050304@rece.vub.ac.be> <57111b0b$0$1606$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de ZeRD3UNR09uagyJgwQoBmQbWpizjAjM1mg7SqWWXi81Q== 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; '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 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> <5710D3DA.6030005@rece.vub.ac.be> <5710E30B.6050304@rece.vub.ac.be> <57111b0b$0$1606$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:107067 On Sat, Apr 16, 2016 at 2:47 AM, Steven D'Aprano 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