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


Groups > comp.lang.python > #89828

Re: Is this a good way to implement testing

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'test,': 0.07; 'deprecated': 0.09; 'latter': 0.09; 'optparse': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'unittest': 0.09; 'whichever': 0.09; 'fashionable.': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'library': 0.18; 'unlike': 0.19; 'proposed': 0.22; 'header:User- Agent:1': 0.23; 'library,': 0.24; 'math': 0.24; 'paul': 0.24; 'header:X-Complaints-To:1': 0.27; 'testing': 0.29; "i'm": 0.30; 'writes:': 0.31; 'option': 0.32; 'quite': 0.32; 'url:python': 0.33; "can't": 0.35; 'but': 0.35; 'acceptable': 0.36; 'library.': 0.36; 'url:org': 0.36; 'should': 0.36; 'unit': 0.37; 'ben': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'url:3': 0.61; 'more': 0.64; 'different': 0.65; 'skip:\xe2 10': 0.65; 'capable': 0.67; 'normal.': 0.68; '8bit%:43': 0.74; '8bit%:46': 0.78; 'subject:this': 0.83; 'received:125': 0.84; 'subject:good': 0.84; '8bit%:33': 0.91; 'migrating': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Is this a good way to implement testing
Date Sun, 03 May 2015 14:49:30 +1000
References <878ud6mx4y.fsf@Equus.decebal.nl> <87k2wq2tx8.fsf@jester.gateway.sonic.net>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock sha1:j+w0SY6GuDN6r9CqRPzj9DXPMYM=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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>
Newsgroups comp.lang.python
Message-ID <mailman.45.1430628582.12865.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1430628582 news.xs4all.nl 2891 [2001:888:2000:d::a6]:42543
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:89828

Show key headers only | View raw


Paul Rubin <no.email@nospam.invalid> writes:

> Cecil Westerhof <Cecil@decebal.nl> writes:
>
> >             action = options[0][0]
> >             if   action == '--all': ...
>
> Yecch, use an option parsing library for that, whichever one is
> currently fashionable. I think optparse is deprecated now but I still
> use it because I'm used to it.

Yes, ‘optparse’ has been superseded by the more capable ‘argparse’
library <URL:https://docs.python.org/3/library/argparse.html>.

Migrating from ‘optparse’ to ‘argparse’ is quite straightforward, since
the latter was designed to be very similar.

> > Is this an acceptable way of working?
>
> You should also use the currently fashionable unit testing library. I
> use unittest because yada yada but I think it's now considered old
> school.

I disagree, using ‘unittest’ is still quite normal. It's also in the
standard library, unlike proposed replacements.

-- 
 \       “Instead of having ‘answers’ on a math test, they should just |
  `\               call them ‘impressions’, and if you got a different |
_o__)   ‘impression’, so what, can't we all be brothers?” —Jack Handey |
Ben Finney

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


Thread

Is this a good way to implement testing Cecil Westerhof <Cecil@decebal.nl> - 2015-05-03 00:29 +0200
  Re: Is this a good way to implement testing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-03 00:17 +0100
  Re: Is this a good way to implement testing Terry Reedy <tjreedy@udel.edu> - 2015-05-02 20:06 -0400
  Re: Is this a good way to implement testing Paul Rubin <no.email@nospam.invalid> - 2015-05-02 20:58 -0700
    Re: Is this a good way to implement testing Ben Finney <ben+python@benfinney.id.au> - 2015-05-03 14:49 +1000
  Re: Is this a good way to implement testing Cecil Westerhof <Cecil@decebal.nl> - 2015-05-03 09:36 +0200
    Re: Is this a good way to implement testing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-03 09:38 +0100
    Re: Is this a good way to implement testing Peter Otten <__peter__@web.de> - 2015-05-03 10:45 +0200
      Re: Is this a good way to implement testing Cecil Westerhof <Cecil@decebal.nl> - 2015-05-03 11:49 +0200
        Re: Is this a good way to implement testing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-03 11:21 +0100
          Re: Is this a good way to implement testing Cecil Westerhof <Cecil@decebal.nl> - 2015-05-03 12:50 +0200
    Re: Is this a good way to implement testing Ben Finney <ben+python@benfinney.id.au> - 2015-05-03 18:52 +1000
  Re: Is this a good way to implement testing Peter Otten <__peter__@web.de> - 2015-05-03 11:22 +0200

csiph-web