'Replace the __main__ module with a fake one, so that it can be mutated
in tests'

def setUp(self):

    self.realMain = sys.modules['__main__']
    self.fakeMain = sys.modules['__main__'] = FakeModule()
