@patch('prestoadmin.main.crawl')
    @patch('prestoadmin.fabric_patches.crawl')
    def test_too_many_args(self, crawl_mock, crawl_mock_main):
        def task(arg1):
            """This is my task"""
            pass

        crawl_mock.return_value = task
        crawl_mock_main.return_value = task
        state.env.nodeps = False
        try:
            main.run_tasks([('my task', ['arg1', 'arg2'], {}, [], [], [])])
        except __HOLE__ as e:
            self.assertEqual(e.code, 2)
        self.assertEqual('Incorrect number of arguments to task.\n\n'
                         'Displaying detailed information for task '
                         '\'my task\':\n\n    This is my task\n\n',
                         self.test_stdout.getvalue())
dataset/ETHPy150Open prestodb/presto-admin/tests/unit/test_main.py/TestMain.test_too_many_args