fix flaky tests

Python 2.6 does not handle float error well as 2.7+