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


Groups > comp.lang.python > #89825

Re: Is this a good way to implement testing

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Is this a good way to implement testing
Date Sat, 02 May 2015 20:58:59 -0700
Organization A noiseless patient Spider
Lines 17
Message-ID <87k2wq2tx8.fsf@jester.gateway.sonic.net> (permalink)
References <878ud6mx4y.fsf@Equus.decebal.nl>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="22184b02e80198190244f5a2dd813f11"; logging-data="23504"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+W5aNIVXbuEJIQAvZGUwE0"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:hMskAqFa1EdqIbla69xUNIbEhrc= sha1:fzaxmELUTElp9k7bXuioz3e5S/8=
Xref csiph.com comp.lang.python:89825

Show key headers only | View raw


Cecil Westerhof <Cecil@decebal.nl> writes:

> Still on my journey to learn Python.
>
> At the moment I define the test functionality in the following way:
>             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.

> 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.

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