Skip to content

Instantly share code, notes, and snippets.

@kasvith
Last active July 16, 2018 11:07
Show Gist options
  • Save kasvith/44562621d2627edca17781674feef0ed to your computer and use it in GitHub Desktop.
Save kasvith/44562621d2627edca17781674feef0ed to your computer and use it in GitHub Desktop.
Hello World Test for python
import unittest
import hello
# Initialize a class to use with unittest framework
class HelloTest(unittest.TestCase):
# Test the hello world function from hello.py
def testHelloWorld(self):
# check whether the 'hello world' is returned by the method
self.assertEqual(hello.helloWorld(), 'hello world')
# run unit test
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment