def setUp(self):
        """
        Add our example directory to the path and record which modules are
        currently loaded.
        """
        self.originalPath = sys.path[:]
        self.originalModules = sys.modules.copy()

        # Python usually expects native strs to be written to sys.stdout/stderr
        self.fakeErr = NativeStringIO()
        self.patch(sys, 'stderr', self.fakeErr)
        self.fakeOut = NativeStringIO()
        self.patch(sys, 'stdout', self.fakeOut)

        # Get documentation root
        here = (
            FilePath(__file__)
            .parent().parent().parent().parent()
            .child('docs')
        )

        # Find the example script within this branch
        for childName in self.exampleRelativePath.split('/'):
            here = here.child(childName)
            if not here.exists():
                raise SkipTest(
                    "Examples (%s) not found - cannot test" % (here.path,))
        self.examplePath = here

        # Add the example parent folder to the Python path
        sys.path.append(self.examplePath.parent().path)

        # Import the example as a module
        moduleName = self.examplePath.basename().split('.')[0]
        self.example = __import__(moduleName)

        Add our example directory to the path and record which modules are
        currently loaded.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_examples.py