Created
October 21, 2015 20:40
-
-
Save pop/c199edbc3e864d36ee89 to your computer and use it in GitHub Desktop.
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
#/usr/bin/python3.5 | |
import unittest | |
def add(x, y): | |
if x == y: | |
raise ValueError('X cannot equal Y because reasons') | |
else: | |
return x + y | |
class TestyTesterson(unittest.TestCase): | |
def test_add_fails_duplicates(self): | |
add(5,5) | |
with self.assertRaises('ValueError'): | |
pass | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment