tests: use range() in generate-churning-module.py
This is a test-only script. Performance on Python 2 for creating a
full list instead of a generator doesn't matter.
With this change, test-check-pyflakes.t passes on Python 3!
Differential Revision: https://phab.mercurial-scm.org/D7019
tests: allow warning about file
The code is protected by a block that makes it Python 2 only, so
use of file is acceptable.
Differential Revision: https://phab.mercurial-scm.org/D7018