Weekly Check-In #3

Published: 06/28/2021

This week my work is try and get the tests working that were previously not working with python version 2. There are 11 such tests that pass only on python 3 and not on python 2.

What did I do this week?

This week I searched and fixed the bug that was causing 11 tests to fail on python 2 and pass without any issue on python 3. After much grinding I realized the issue was in the way python 2 handled strings. As the tests were written on a python 3 environment, when evaluated on a python 2 environment, they threw errors if a sequence of characters enclosed within curly brackets was compared to a string object(str). Python 2 has an unicode object which is quite similar to str in Python 3 but not identical. Due to this, issues arise in the way a string is compared in both python versions.

Did I get stuck anywhere

Not really, but finding the correct way in which strings are handled on different versions took some considerable research and patience. The problem was to write code that would make the tests run smoothly on both versions. For this I needed to know exactly what a function used in the tests returned. Whether it was a string or byte-string or some other data type. Also apart from these problems, while fixing some tests, I had to re record some cassettes to find the error.