tests/helpers.py: pep8 and pylint improvements