[test_tools] Fix incompatibility with Python 3.

In Python 3 filter of course returns a generator.