Skip to content

Instantly share code, notes, and snippets.

@zacharyvoase
Forked from winhamwr/test.py
Created September 1, 2012 02:43
Show Gist options
  • Save zacharyvoase/3562977 to your computer and use it in GitHub Desktop.
Save zacharyvoase/3562977 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