Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion unit testing

View parsed - Show only message text

Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!transit.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path: <showel...@yahoo.com>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@bag.python.org
X-Spam-Status: OK 0.032
X-YMail-OSG: 2R1d6BcVM1nUNWhToLrbhzqWGI090ojlPB5TVdVmr__mqxxGOXcsUyk2Gbk9b.j4oT9SSrG5LeEW8zMH3ef6RRTWYZa3DaT_BbXwSArGo3QK3FNXtgVctvxpB0XsBw--
Date: Sun, 27 May 2007 12:14:54 -0700 (PDT)
From: Steve Howell <showel...@yahoo.com>
Subject: unit testing
To: python-l...@python.org
In-Reply-To: <FsadnQRcQORlScTbnZ2dnUVZ_jGdnZ2d@comcast.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-BeenThere: python-l...@python.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: General discussion list for the Python programming language
	<python-list.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/listinfo/python-list>,
	<mailto:python-list-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
	<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.8273.1180293302.32031.python-list@python.org>
Lines: 59
NNTP-Posting-Host: 194.109.207.14
X-Trace: 1180293302 news.xs4all.nl 336 [::ffff:194.109.207.14]:43008
X-Complaints-To: abuse@xs4all.nl

--- Steven Bethard <steven.beth...@gmail.com> wrote:
> Have you tried py.test?
> 
>      http://codespeak.net/py/dist/test.html
> 
> I've heard good things about it, but haven't gotten
> around to trying it 
> yet. Here's a two-line test suite from the page
> above:
> 
>      def test_answer():
>          assert 42 == 43
> 

Changed the subject line.

Nope, I haven't.  I'm a tremendous advocate of unit
testing, but I've never felt compelled to try out
other libraries, because I work mostly on private code
now, so the
following-standard-practices-to-benefit-from-familiarity
argument doesn't carry much weight with me, and also
because I find it easy enough to do things on a
roll-your-own basis.  YMMV, of course.

I have slowly introduced unit testing into my own work
environment, with some success.  We don't use a 3rd
party testing framework, but here's my roll-your-own
approach:

   1) For flat-out failures, we just fail with a
traceback right away.  We don't bother to capture
stats on how many tests failed.  If one test fails,
that's enough to clue in a developer that he/she broke
something.

   2) We don't use assertions very often, but rather
just diff the output files to the GOLD files.  This
may eventually stop to scale, but it hasn't yet.

   3)We have a little trickery to override imports,
etc., as 99.99% of our code was never written with
unit testing in mind, but I still want to regression
test it.

  4) We have quite a few mock-ish objects, mainly
relating to simulating I/O situations.



  





       
____________________________________________________________________________________Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google