Skip to content

Instantly share code, notes, and snippets.

@pop
Created October 21, 2015 20:40
Show Gist options
  • Save pop/c199edbc3e864d36ee89 to your computer and use it in GitHub Desktop.
Save pop/c199edbc3e864d36ee89 to your computer and use it in GitHub Desktop.
#/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