/unittest_with_nose

Sample unit tests in python

Primary LanguagePython

Why

If you code and want to protect your code from breaking in future and automatic test in present, unit tests is the way. And unit test with test runner nosetest makes TDD easier & powerful.

What

Sample project to understand writing unittests nicely using noetstests.

Major components

  • Basics: Read here

  • How to cover most cases with least writing (parameterize your test)

  • How to speed up tests which have DB calls or external API calls (use mock & autospec)

    Step by Step Samples here

For all questions why or why not Test Driven Development Read here