nose-parameterized

Logiciel capture d'écran:
nose-parameterized
Détails logiciels:
Version: 0.3.1
Date de transfert: 14 Apr 15
Développeur: David Wolever
Licence: Gratuit
Popularité: 3

Rating: 3.0/5 (Total Votes: 1)

nez patameterized est un décorateur pour le test paramétré avec le nez.
Nez. Il est obtenu générateurs de test. Mais ils genre de sucer, parce que:
- Ils exigent souvent une deuxième fonction
- Ils font qu'il est difficile de séparer les données de l'essai
- Ils ne fonctionnent pas avec subclases de unittest.TestCase
Mais correctifs nez-paramétré.
Vérifiez-le:
 chat test_math.py
de nose.tools importation assert_equal
importation de nose_parameterized paramétré
unittest d'importation
maths à l'importation
parameterized ([
& Nbsp; (2, 2, 4),
& Nbsp; (2, 3, 8),
& Nbsp; (1, 9, 1),
& Nbsp; (0, 9, 0),
])
def test_pow (base, exposant, devrait):
& Nbsp; assert_equal (Math.pow (base, exposant), attendu)
classe TestMathUnitTest (unittest.TestCase):
& Nbsp; @ parameterized.expand ([
& Nbsp; (- 1,5, -2,0),
& Nbsp; (1.0, 1.0),
& Nbsp; (1.6, 1),
& Nbsp;])
& Nbsp; def test_floor (auto, entrée, prévu):
& Nbsp; assert_equal (Math.floor (entrée), attendu)
$ Nosetests -v test_math.py
test_math.test_pow (2, 2, 4) ... ok
test_math.test_pow (2, 3, 8) ... ok
test_math.test_pow (1, 9, 1) ... ok
test_math.test_pow (0, 9, 0) ... ok
test_floor_0 (test_math.TestMathUnitTest) ... ok
test_floor_1 (test_math.TestMathUnitTest) ... ok
test_floor_2 (test_math.TestMathUnitTest) ... ok
-------------------------------------------------- --------------------
Ran sept essais dans 0.002s
OK

Exigences :

  • Python
  • nez

Logiciel similaire

KaliVeda
KaliVeda

20 Feb 15

pyzombie
pyzombie

12 May 15

selenose
selenose

20 Feb 15

nose-json
nose-json

14 Apr 15

Commentaires à nose-parameterized

Commentaires non trouvées
Ajouter un commentaire
Tourner sur les images!