Skip to content

Instantly share code, notes, and snippets.

@andy47
Last active December 19, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andy47/5893166 to your computer and use it in GitHub Desktop.
Save andy47/5893166 to your computer and use it in GitHub Desktop.
Unittest tests for our example function.
from parse_conn import parse_connection
import unittest
class InvalidInputs(unittest.TestCase):
def testNoAt(self):
"""parse_connection should raise an exception
for an invalid connection string"""
self.assertRaises(ValueError, parse_connection, 'invalid uri')
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment