I have a practice scenerio to define a test test_isEven1, inside TestIsEvenMethod, that checks if isEven(5) returns False or no

I have a practice scenerio to define a test test_isEven1, inside TestIsEvenMethod, that checks if isEven(5) returns False or not.

import unittest

class TestIsEvenMethod(unittest.TestCase):
def isEven(n):
if n%2==0:
print(“True”)
else:
print(“False”)

def test_isEven1(self):
    result = isEven(5)
    self.assertEqual(result,false)

if name == ‘main’:
unittest.main()


In O/p, i am getting below error -

I have a practice scenerio to define a test test_isEven1, inside TestIsEvenMethod, that checks if isEven(5) returns False or not. import unittest class TestIsEvenMethod(unittest.TestCase): def isEven(n): if n%2==0: print(“True”) else: print(“False”) def test_isEven1(self): result = isEven(5) self.assertEqual(result,false) if name == ‘main’: unittest.main()

x

I have a practice scenerio to define a test test_isEven1, inside TestIsEvenMethod, that checks if isEven(5) returns False or not.

import unittest

class TestIsEvenMethod(unittest.TestCase):

def isEven(n):

if n%2==0:

print(“True”)

else:

print(“False”)

def test_isEven1(self):

result = isEven(5)

self.assertEqual(result,false)

if name == ‘main’:

unittest.main()

E ====================================================================== ERROR: C:\Users\Satish\AppData\Roaming\jupyter\runtime\kernel-257a7552-61f4-4bcb-8083-c1f661a3c04d (unittest.loader._FailedTest) ---------------------------------------------------------------------- AttributeError: module ‘main’ has no attribute ‘C:\Users\Satish\AppData\Roaming\jupyter\runtime\kernel-257a7552-61f4-4bcb-8083-c1f661a3c04d’ ---------------------------------------------------------------------- Ran 1 test in 0.009s FAILED (errors=1)

An exception has occurred, use %tb to see the full traceback. SystemExit: True

c:\users\satish\appdata\local\programs\python\python38\lib\site-packages\IPython\core\interactiveshell.py:3339: UserWarning: To exit: use ‘exit’, ‘quit’, or Ctrl-D. warn(“To exit: use ‘exit’, ‘quit’, or Ctrl-D.”, stacklevel=1)