python doctest: expected result is the same as the “got” result but the test failed
问题 I am on a learning stage of using python as a tool for software QA. I wrote the next simple test in order to find the letter 'a' in a text file number matrix. problem is that the test fails even though the expect equals to what i got. Why is that? Can you tell me what am I doing wrong? test script: fin = open("abc.txt", "r") arr_fin = [] for line in fin: arr_fin.append(line.split()) print arr_fin for row in arr_fin: arr_fin_1 = " ".join('{0:4}'.format(i or " ") for i in row) print arr_fin_1