I would like some help writing a unit test that would test a print output. Here's my code:
import random
friends_list = ["Monica","Joey", "Pheobe", "Chandler", "Rachel", "Ross"]
Friend=random.choice(friends_list)
print(friend)
How would I test to ensure the "Friend" printed?
So far I tried:
def test_friends():
friends.
Not sure what to do after this
You can use the
unittestmodule to write a unit test to ensure that the name of the friend is printed.Output: