Skip to content

Instantly share code, notes, and snippets.

@winhamwr
Created August 2, 2011 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save winhamwr/1120673 to your computer and use it in GitHub Desktop.
Save winhamwr/1120673 to your computer and use it in GitHub Desktop.
Nose generator tests example
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