Last active
May 15, 2017 14:58
-
-
Save rdammkoehler/64a760d029de77c922f4bb5d290d5783 to your computer and use it in GitHub Desktop.
Super DRY Foo Test
This file contains 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 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