Defining functions in the current module was causing the entirety of py.test and all dependencies to be sucked in.