CommencerCommencer gratuitement

Writing some basic tests

If you have written a full suite of tests for your code, it means you can develop and modify it more freely. If you make some changes that break your code, you'll be able to find this out right away. It also signals to users that your code is more likely to be error free, and can be trusted to do its job.

The tests you write will check that your functions give the expected outputs for given inputs. In this case you will be writing numeric tests to make sure that the correct answer is returned when converting a number of inches to feet and vice versa.

In this exercise, you'll write a test for one of your functions inside impyrial.

Cet exercice fait partie du cours

Developing Python Packages

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice