Making unit tests more 'Pythonic'