Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Anyone facing similar error in test03?

aryanahamed (7920 points)
6 12 67
in HW4 by (7.9k points)
closed by

My code fails the test03_example (It passes all the other tests) and shows the following error,

test_01.py:39: in do_test
    self.assertDictEqual(expected, result)
E   AssertionError: {'The frightened cross-contamination predicts sp[27789 chars] 379} != {'The flaky executor repairs mule.': 481, 'The i[27790 chars] 520}
E   Diff is 29780 characters long. Set self.maxDiff to None to see it.

But I compared both index.txt files in test03.out and test03.expected directories using notepad++ comparison plugin which shows both files are identical. 

Can anyone advise me on how can I debug this problem or is there any issue with the tests? Thanks!

Edit: I had issues with my code logic but it didn't appear until I used encoding="utf-8" in the open() function. 

262 views
closed with the note: Problem solved! Check the question edit.

3 Answers

Leoo89 (1110 points)
2 4 7
by (1.1k points)

Make sure to pass the parameter encoding="utf-8" to all the calls of the open function, and make sure that you unzipped the files using WinRar or 7Zip instead of Explorer, since there is a file called "The clumsy jalapeño springs instinct" that may give problems because of the letter ñ

mivige (7870 points)
2 4 34
by (7.9k points)
In test03 there are some bugs when you execute it in local, I also had this issue but on the vm it runs normally...
angelo.spognardi (8190 points)
77 156 226
by (8.2k points)
Please double-check your return: from the error message you copied, it appears that the error does not concern the created file but the returned dictionary.