Created this simple unit test as shown bellow
calculator_tester.py
import unittest
class MathsTest(unittest.TestCase):
def test_createOperation(self):
operation = Mathoperation()
This is the only test file I have created and Note there doesnot exist a class call Mathoperation() that is defined inside the test method. n When running this sample test code using the python test runner
python -m unittest
output:
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
Expectation:
I was expecting the test case to run and throw NameError: global name Mathoperation is not defined. But the test case didn't run.
What is the sample test case not running. I am running it on python version 2.7.12