Hello everyone, I want to do a data check that is in csv and variable. I use unittest for this. The verification works, but there is a problem that if the data does not match, I cannot know where the problem is, namely in csv or in a variable. How can I get information in which place there is an error?
tb_row = [u'120 dev 15.61', u'126 kor 12.96', u'128 itsw 20.58'] for i, x in enumerate(tb_row): tb_row[i] = x rows = [] with open('/home/max/Desktop/test.csv', 'rb', ) as csvfile: the_file = csv.reader(csvfile, delimiter=',') for row in the_file: rows.extend([x.decode('utf8') for x in row]) q = u' '.join(tb_row).split() w = u' '.join(rows).split() for index, value in enumerate(q): # comparing csv with web self.assertEqual(w[index], value)