def test_skipSubcommandList(self):
        """
        Ensure the optimization which skips building the subcommand list
        under certain conditions isn't broken.
        """
        outputFile = BytesIO()
        self.patch(usage.Options, '_shellCompFile', outputFile)
        opts = FighterAceOptions()

        self.assertRaises(SystemExit, opts.parseOptions,
                          ["--alba", "--_shell-completion", "zsh:2"])
        outputFile.seek(0)
        # test that we got some output
        self.assertEqual(1, len(outputFile.read(1)))

        Ensure the optimization which skips building the subcommand list
        under certain conditions isn't broken.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_shellcomp.py