Created
August 2, 2011 17:10
-
-
Save winhamwr/1120673 to your computer and use it in GitHub Desktop.
Nose generator tests example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nose.tools import assert_equal | |
addition_cases = [ | |
( | |
'2 + 2', | |
2, | |
2, | |
4 | |
), | |
( | |
'4 + 4', | |
4, | |
4, | |
8 | |
), | |
] | |
def test_clean_html(): | |
for description, num1, num2, expected in addition_cases: | |
def run(): | |
result = num1 + num2 | |
assert_equal(result, expected) | |
run.description = 'addition %s' % description | |
yield run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment