def test_filenameNotPython(self):
        """
        L{runner.filenameToModule} raises a C{SyntaxError} when a non-Python
        file is passed.
        """
        filename = filepath.FilePath(self.parent).child('notpython')
        filename.setContent(b"This isn't python")
        self.assertRaises(
            SyntaxError, runner.filenameToModule, filename.path)

        L{runner.filenameToModule} raises a C{SyntaxError} when a non-Python
        file is passed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_loader.py