nose-parameterized

Software screenshot:
nose-parameterized
Podrobnosti Software:
Verze: 0.3.1
Datum uploadu: 14 Apr 15
Vývojka: David Wolever
Licence: Volný
Popularita: 3

Rating: 3.0/5 (Total Votes: 1)

nos-patameterized je malíř pro parametrické testování s nosem.
Nose. Má to zkušební generátory. Ale trochu sát, protože:
- Často vyžadují druhou funkci
- Díky nim je obtížné oddělit data z testu
- Oni nepracují s subclases z unittest.TestCase
Ale nos-parametricky opravy.
Zkontrolovat:
 cat test_math.py
od nose.tools dovozu assert_equal
od nose_parameterized dovozu parametrizován
import unittest
import math
parameterized ([
& Nbsp; (2, 2, 4),
& Nbsp; (2, 3, 8),
& Nbsp; (1, 9, 1),
& Nbsp; (0, 9, 0),
])
def test_pow (base, exponent, očekávané):
& Nbsp; assert_equal (math.pow (base, exponent), očekávané)
třída 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 (self, vstup, očekávaný):
& Nbsp; assert_equal (math.floor (vstup), očekávané)
$ 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 7 testy 0.002s
OK

Požadavky na :

  • Python
  • nos

Podobný software

nose-skipreq
nose-skipreq

12 May 15

dfuzz
dfuzz

12 May 15

nose-bisect
nose-bisect

14 Apr 15

teamcity-messages
teamcity-messages

15 Apr 15

Komentáře k nose-parameterized

Komentáře nebyl nalezen
Přidat komentář
Zapnout obrázky!