Jul-15-2020, 04:06 AM
My test file is as below:
In the code given above, the last two lines I have commented. Even when these were enabled, VSCode was not able to discover the tests.
from unittest import TestCase import pytest class TestNumbers(TestCase): def TestSum(self): self.assertEqual(AddNum(5,6), 11) def TestDiff(self): self.assertEqual(SubtractNum(6,3),3) obj = TestNumbers() obj.TestSum() obj.TestDiff() # if __name__ == "__main__": # unittest.main()I have set VSCode configuration. Enabled test framework and set it to use pyTest. But each time I start VSCode, it shows message to select Test Framework as no tests were discovered.
In the code given above, the last two lines I have commented. Even when these were enabled, VSCode was not able to discover the tests.