Fix fragile unit test that fails on python 2.6