MulaiMulai sekarang secara gratis

List with a custom length

You already saw a list preparation implemented as a fixture. But what if you also want to customize the preparation process? For example, one might want to set a custom length for a generated list. You can implement it with chain fixture requests by making the "length" a separate fixture; let's call it list_length(). In the end, you will have a test function that requests the list, and the list is then generated by requesting the list_length().

Latihan ini adalah bagian dari kursus

Introduction to Testing in Python

Lihat Kursus

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga