MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Developing Python Packages

Lihat Kursus

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga