def int_check(to_check): while True: error = "Please enter an integer mor then / equal to 13." # check for infinite mode if to_check == "": return "infinite" try: response = int(to_check) # checks that the number is more / equal to 13 if game_goal < 13: print(error) else: return response except ValueError: print(error) # Automated testing is below in the form (test_case, expected value) to_test = [ ("xlii", "invalid"), ("0.5", "invalid"), ("0", "invalid"), (1, 1), (2, 2), ("", "infinite"), ] # run tests! for item in to_test: #retrive test case and expected value case = item[0] expected = item [1] # get actual value (ie: test ticket function) actual = int_check(case, ["rock", "paper", "scissors"]) # compare actual and expected and output pass / fail