Created
August 10, 2018 03:57
-
-
Save christinebuckler/5849f36657c95cd191874c74b095ed87 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
''' | |
To run test files, type the following into the terminal | |
py.test file.py –vv | |
''' | |
import unittest as unittest | |
from folder.file import MyClass | |
class TestMyClass(unittest.TestCase): | |
def test_myfunction(self): | |
myinstance = MyClass(someinput) | |
actual_output = myinstance.myfunction() | |
correct_output = value | |
self.assertAlmostEqual(actual_output, correct_output, \ | |
msg='The actual output was {}, the correct output is {}.'.format(actual_output,correct_output)) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment