def mocked_open(*args, **kwargs):
            """
            Mock for the open call to prevent actually opening a log file.
            """
            open_calls.append((args, kwargs))
            io = NativeStringIO()
            io.name = args[0]
            open_rvalues.append(io)
            return io

            Mock for the open call to prevent actually opening a log file.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_policies.py