I have a beginner Python program that generates random output and does not take any input. For example, it simulates rolling a dice 5 times and prints the results, their sum, and average:
import random
total = 0
rolls = ""
for i in range(5):
roll = random.randint(1, 6)
rolls += str(roll) + " "
print(rolls)
print(total)
print(total / 5)
How can I create valid test cases in Polygon for a Python program that:
Does not read input
Produces random output
…without modifying thecode?
polygontag because that refers to the geometric notion of polygon. What is "Polygon" in this context? Is there some testing framework for Python called "Polygon"? (I'm not seeing anything that looks relevant on PyPI.)