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