nose-parameterized

Screenshot Software:
nose-parameterized
Szczegóły programowe:
Wersja: 0.3.1
Filmu: 14 Apr 15
Wywoływacz: David Wolever
Licencja: Wolny
Popularność: 3

Rating: 3.0/5 (Total Votes: 1)

nos patameterized jest dekoratorem do testów z nosa sparametryzowanego.
Nos. Jest tam generatory testów. Ale rodzaju ssać, ponieważ:
- Często wymagają drugą funkcję
- Są one utrudniają oddzielenie danych z testu
- Oni nie działają z subclases z unittest.TestCase
Ale nos parametryzowane poprawek.
Sprawdź to:
 Kot test_math.py
z nose.tools importu assert_equal
z nose_parameterized importu nastawiç
Import unittest
import math
parameterized ([
& Nbsp; (2, 2, 4)
& Nbsp; (2, 3, 8),
& Nbsp, (1, 9, 1),
& Nbsp; (0, 9, 0),
])
test_pow def (podstawa, wykładnik, oczekiwano):
& Nbsp; assert_equal (Math.pow (podstawa, wykładnik), spodziewane)
Klasa 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 (samodzielne wejście, oczekiwano):
& Nbsp; assert_equal (Math.floor (wejście), spodziewane)
$ 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 testów w 0.002s
OK

Wymagania :

  • Python
  • nos

Podobne oprogramowanie

matchmaker
matchmaker

14 Apr 15

Attest
Attest

14 Apr 15

ParamUnittest
ParamUnittest

20 Feb 15

TextTest
TextTest

18 Jul 15

Komentarze do nose-parameterized

Komentarze nie znaleziono
Dodaj komentarz
Włącz zdjęć!