def test_trialPathInsert(self):
        """
        The trial script adds the current working directory to sys.path so that
        it's able to import modules from it.
        """
        script = self.bin.child("trial")
        if not script.exists():
            raise SkipTest(
                "Script tests do not apply to installed configuration.")
        cwd = getcwd()
        self.addCleanup(chdir, cwd)
        testDir = FilePath(self.mktemp())
        testDir.makedirs()
        chdir(testDir.path)
        testDir.child("foo.py").setContent("")
        output = outputFromPythonScript(script, 'foo')
        self.assertIn("PASSED", output)

        The trial script adds the current working directory to sys.path so that
        it's able to import modules from it.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/scripts/test/test_scripts.py