Skip to content

Instantly share code, notes, and snippets.

@rdammkoehler
Last active May 15, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdammkoehler/64a760d029de77c922f4bb5d290d5783 to your computer and use it in GitHub Desktop.
Save rdammkoehler/64a760d029de77c922f4bb5d290d5783 to your computer and use it in GitHub Desktop.
Super DRY Foo Test
from unittest import TestCase
import nose.tools as nt
def foo(x,y):
return (x+y), (x*y)
class FooTests_1(TestCase):
def setUp(self):
x = 5
y = 5
(self.add_result,self.multiply_result) = foo(x,y)
def test_foo_does_add(self):
nt.assert_equals(10, self.add_result)
def test_foo_does_multiply(self):
nt.assert_equals(25, self.multiply_result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment