def test_listLogsWithBadlyNamedFiles(self):
        """
        L{LogFile.listLogs} doesn't choke if it encounters a file with an
        unexpected name.
        """
        log = logfile.LogFile(self.name, self.dir)
        self.addCleanup(log.close)

        with open("{0}.1".format(log.path), "w") as fp:
            fp.write("123")
        with open("{0}.bad-file".format(log.path), "w") as fp:
            fp.write("123")

        self.assertEqual([1], log.listLogs())

        L{LogFile.listLogs} doesn't choke if it encounters a file with an
        unexpected name.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_logfile.py