Code Maven

Search for '{{search_term}}'

Welcome to the Code Maven!

Programming Exercises for any language.

For now, just read the articles...

If you want to make sure you don't miss any new articles, you can subscribe to the Code Maven newsletter, follow via atom feed, Twitter, or even my Google+ account.

Introduction to Python unittest

Using doctest is nice, but it is not very good for large test suites.

The unittest module is another standard module that provides a much more powerful way to write tests and despite its name it can be used to write integration and acceptance tests just as well as unittests.


Introduction to Python unittest


Doctest in Python

There are several testing libraries in Python. One of the simplest is called doctest. It is good for stand-alone libraries, not something where you need a lot of work to set up the environment, but then it is a great way to also ensure that the documentation is correct.


Doctest in Python


Testing Python: Getting started with Pytest

While we can use either doctest or unittest without installing any extra module, today, it seems to most recommended testing library for Python is the pytest. In this article we'll see how to start using it.


Testing Python: Getting started with Pytest