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


Groups > comp.lang.python > #111879 > unrolled thread

Re: Unittest

Started byTerry Reedy <tjreedy@udel.edu>
First post2016-07-26 01:57 -0400
Last post2016-07-26 01:57 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Unittest Terry Reedy <tjreedy@udel.edu> - 2016-07-26 01:57 -0400

#111879 — Re: Unittest

FromTerry Reedy <tjreedy@udel.edu>
Date2016-07-26 01:57 -0400
SubjectRe: Unittest
Message-ID<mailman.122.1469512678.22221.python-list@python.org>
On 7/25/2016 12:45 PM, Joaquin Alzola wrote:
> Hi Guys
>
> I have a question related to unittest.
>
> I suppose a SW that is going to live will not have any trace of
> unittest module along their code.

In order to test idlelib, I had to a _utest=False (unittest = False) 
parameter to some functions.  They are there when you run IDLE.

I like to put

if __name__ == '__main__': <run this file's unittest test> at the bottom 
of non-script files.  Some people don't like this, but it makes running 
the tests trivial while editing a file -- whether to make a test pass or 
to avoid regressions when making 'neutral' changes.

> So is it the way to do it to put all unittest in a preproduction
> environment and then remove all lines relate to unittest once the SW
> is release into production?

How would you know that you do not introduce bugs when you change code 
after testing?

When you install Python on Windows, installing the test/ directory is a 
user option.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web