Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '[1]:': 0.09; 'option,': 0.09; 'unittest': 0.09; 'val': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; '[1].': 0.16; 'failure.': 0.16; 'filename:fname piece:signature': 0.16; 'gnupg': 0.16; 'loop.': 0.16; 'received:76.96': 0.16; 'received:mail.comcast.net': 0.16; 'sat,': 0.16; 'url:org)': 0.16; 'wrote:': 0.18; 'library': 0.18; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'advise.': 0.24; 'received:comcast.net': 0.24; 'stick': 0.24; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'signed': 0.27; 'header:In-Reply-To:1': 0.27; 'received:24': 0.27; "i'm": 0.30; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'anyone': 0.31; 'url:python': 0.33; 'something': 0.35; 'charset :us-ascii': 0.36; 'url:org': 0.36; 'received:76': 0.38; 'url:library': 0.38; 'break': 0.61; 'url:3': 0.61; 'information,': 0.61; 'first': 0.61; 'content-disposition:inline': 0.62; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'url:4': 0.69; '3.4': 0.84; 'trevor': 0.84; 'encrypted': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1389500919; bh=1/NITt9QkYI1hS7yL14S1fGh+2LNvqhHXaQR5XrJ1Uw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Xo7DSbqTr5jec73FpVyFiD7vksmHexncE3O7coIPsrgwL/gOi/veOzi68/sBuK+Xy YlESdZEYIxD5LHp5o01EadwnsUDyzuhBnsgn+sDJzT3+L7gv+2XltZffuiiLYs6KQV oCr3zV4iH2mxaujkq1avM9meszHHBOjr+NDxY4w4= Date: Sat, 11 Jan 2014 20:28:38 -0800 From: "W. Trevor King" To: CraftyTech Subject: Re: parametized unittest References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Hy6Wd/+xmQCqA1QQ" Content-Disposition: inline In-Reply-To: OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; url=http://tremily.us/pubkey.txt User-Agent: Mutt/1.5.22 (2013-10-16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1389500921; bh=BHKo0G7ndjhL66RzUlFZK7iBxpniGYwBQ7uWdm0LxsU=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=dh1XfOB+BBBuTRY9+7lkoXHOBpaNzehPAcL71RjMK1YtOE+iPwV2SWXyZfbqGWlye ikzSmbPR7DBXWIcowghb5/zibXIMF1YadTRjqncCr5KxbyDlJmhpgBlNCSCUdhPQFT EmFT1WgWjU1IoLCR+oP8fqZ6zbF0ucorSp/CZbjaiSe2Iy3TMMsgKy2zsf2WV/Apc/ fE4FogejjVol4X6HTmBkK2gJx5S6jy1mB8E2of7fp+G3Rh0iGzuBrmRt+UUZMzaFOd k2kcry9NiL/cIpw349FCVafvYsN+pK6/E2FSlhb4O97PM/y2pG3ir3PZ5QbehOHgJO Nq91YhJHU6Cnw== Cc: python-list@python.org 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389500996 news.xs4all.nl 2888 [2001:888:2000:d::a6]:55826 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63748 --Hy6Wd/+xmQCqA1QQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 11, 2014 at 08:00:05PM -0800, CraftyTech wrote: > I'm finding it hard to use unittest in a for loop. Perhaps something lik= e: >=20 > for val in range(25): > self.assertEqual(val,5,"not equal) >=20 > The loop will break after the first failure. Anyone have a good > approach for this? please advise. If Python 3.4 is an option, you can stick to the standard library and use subtests [1]. Cheers, Trevor [1]: http://docs.python.org/3.4/library/unittest.html#distinguishing-test-i= terations-using-subtests --=20 This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy --Hy6Wd/+xmQCqA1QQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJS0hnyAAoJEKKfehoaNkbttOsP/iI5ld0aK0KHFi7mm1MjJr66 ZAq3wCaG7TVJ7gmsw3k+9qCaNPWX0mTFsxRyNyJbu4ThzcmWCM9ygmIM4lF+Z3ea hxu+oZSJH4Cs6E4o3q57h+cSEHqiyJwcflGYWm2lYHIZgtGdbyutQG5SkPVoCWTV /6eHBYXrDQExrKj5QTlZk3K2zcMjCbluWYTchwwWJ/feV0i28nqatAioCWtVMKi+ LaSbvJHeqUqyQrilBlY5XVwnqHHBfQsMbOiu6UHmTYUbIg6twIGG/re54ud3k8Vj l2WWs3GiQCoS8T4Nd2+0pUnCsxutxRiKQzq9p37uHyvqQjU3GrO9U7NOJ6ONqkDG lv2ka1CsRJwsCqvIgPvxfOHlcidqa2CAheHMpScqJtD3B0jz/wtSt8dZEG2Sb5q0 VjM97uGW3PLCOhSiT2HuII7wU00rP0DGpnVz2gj6vQ6QRYWamO/tjCCGK+LStSPR 6tawasLdn/425uAjhJGHmajfrT6stk44NFjhgHxwHcDCetrtK3o9k3tQxj84GGny /n4O+z2V21QuNS8wXoKwSQIV3HzIdqqzH3Bbge/YE3vCFHSBd7eba4J68cL8njsN F28N8H4QZeVM83CP7u+S/Gad7xoZ8HNpvrxQV6hM5Lv1uNfo+3mS0kqiKgjXvlKK kphs9nLkj7dEbdVofDWk =P5p4 -----END PGP SIGNATURE----- --Hy6Wd/+xmQCqA1QQ--