With py.test you can setup at module level with:

    def setup_module(module):
        # module here is implicitly the current module
        pass