Need advice on writing better test cases.

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Aug 28 04:33:53 EDT 2017


On Mon, 28 Aug 2017 01:55:25 +0530, Anubhav Yadav wrote:

> Can you suggest me the right python testing frameworks that I should be
> using? Right now I am using unittest to write test cases and manual
> if/else statements to run the functional test cases.


A good way to learn unit testing and regression testing is to download 
the Python source code and read the test suites.

Also consider using doc testing, for both documentation and unit tests. 
See the doctest module.

Can you explain what you mean by "functional test cases", and show an 
example or two of the sorts of tests you would write?




-- 
“You are deluded if you think software engineers who can't write 
operating systems or applications without security holes, can write 
virtualization layers without security holes.” —Theo de Raadt



More information about the Python-list mailing list