mercredi 29 avril 2015

How to reuse the same tests to test different implementations?

My language is python 3 and I am trying to understand how to use the same set of tests to test different implementations of the same algorithm.

So far I am looking at the built-in unittest and my impression is that I have to make some sort of a class hierachy: a class that inherits from unittest.TestCase and implements all the actual tests and several descendants from its class that each test particular implementations with the tests from the parent.

However, this is just my idea of how it should look like. Could you please tell me how to actually use the same set of tests to test different functions that implement the same algorithm?

Aucun commentaire:

Enregistrer un commentaire