Ho lavorato con Spock e ho adorato la clausola 'where', che consente di esercitare facilmente il test case con più input e output. Per esempio:C'è una libreria di test Spock-like per Python
class HelloSpock extends spock.lang.Specification {
def "length of Spock's and his friends' names"() {
expect:
name.size() == length
where:
name | length
"Spock" | 5
"Kirk" | 4
"Scotty" | 6
}
}
C'è qualcosa di simile per Python?
Hai trovato qui sotto le risposte utili? –