Last active
November 18, 2018 19:51
-
-
Save enric1994/368218e14b156903f3997023226dbdc6 to your computer and use it in GitHub Desktop.
Python Unit Testing
This file contains hidden or 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
'''Place all the tests in a 'tests' folder, | |
start the name of each file with 'test' (e.g. test_string.py). | |
Finally run: $ python -m unittest discover <tests_folder_location> | |
''' | |
import unittest | |
class TestStringMethods(unittest.TestCase): | |
def test_upper(self): | |
self.assertEqual('foo'.upper(), 'FOO') | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment