def METHOD_NAME(path, ext, ignoreDeprecationWarnings):
    scriptName = os.path.basename(path)[:-3]
    def test(self):
        # get the paths
        testPath = os.path.join(tempTestDataDir, "%s.%s" % (scriptName, ext))
        expectedPath = os.path.join(testDataDir, "expected_%s.%s" % (scriptName, ext))
        expectedOutputPath = os.path.join(testDataDir, "expected_%s.txt" % scriptName)
        expectedOutput = readExpectedOutput(expectedOutputPath)
        # get drawBot
        import drawBot
        # start a new drawing
        drawBot.newDrawing()
        # execute the script in place
        # temporarily ignore deprecation warnings (there are some from PyObjC :( )
        with warnings.catch_warnings():
            if ignoreDeprecationWarnings:
                warnings.simplefilter("ignore", DeprecationWarning)
            output = self.executeScriptPath(path)
        self.assertEqual(cleanupTraceback(output), cleanupTraceback(expectedOutput))
        # save the image
        drawBot.saveImage(testPath)
        # tell drawBot drawing is done
        drawBot.endDrawing()
        self.assertForFileExtension(ext, expectedPath, testPath)
    return test