Although these are synonyms in Python 2.x, when using MyPy to typecheck code use of file() causes spurious errors. This commit also serves as one small step to Python 3.x compatibility, since 3.x removes the file() builtin.
Defining functions in the current module was causing the entirety of py.test and all dependencies to be sucked in.