testing python code

mw_nz_3025915caf4a61ed7

MWæ NZå

Posted on June 3, 2024

testing python code

def test_user_names(first, last):
"""" a function that prompts for user names """

full_name = first + " " + last
return full_name.title()
Enter fullscreen mode Exit fullscreen mode

guys above is my basic python code which is supposed to prompt for user input, first and last names.

note*.. i have written my file name containing the function above with a test_names.py, i have also done the same for the code below

below is the (unittest) code i am using to test if my code behaves correctly.

""" a class to test my test_names.py code"""

import unittest

from test_file_names import user_names

class test_nomencreture(unittest.TestCase):

def test_namesakes(self):
    adder = user_names('john','pedro')
    self.assertEquals(adder, 'john pedro')
Enter fullscreen mode Exit fullscreen mode

unittest.main()

....but for some reason am getting an error ,the test is failing ,the test is not running ,


Ran 0 tests in 0.000s

NO TESTS RAN

Process finished with exit code 5

Empty suite

(i am a beginner forgive me if the error is too basic . i do not know what the empty suite means,your help will be much appreciated

💖 💪 🙅 🚩
mw_nz_3025915caf4a61ed7
MWæ NZå

Posted on June 3, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

testing python code
programming testing python code

June 3, 2024

How can I learn to write simpler code?
programming How can I learn to write simpler code?

December 22, 2023