tests that all CLI help messages don't throw errors

This commit is contained in:
Alex 2022-04-17 12:01:24 -07:00 committed by asp
parent aead27bcbd
commit 636127ec1e
1 changed files with 14 additions and 0 deletions

View File

@ -930,3 +930,17 @@ class MySpider(scrapy.Spider):
args = ['-o', 'example1.json', '-O', 'example2.json']
log = self.get_log(spider_code, args=args)
self.assertIn("error: Please use only one of -o/--output and -O/--overwrite-output", log)
class HelpMessageTest(CommandTest):
def setUp(self):
super().setUp()
self.commands = ["parse", "startproject", "view", "crawl", "edit",
"list", "fetch", "settings", "shell", "runspider",
"version", "genspider", "check", "bench"]
def test_help_messages(self):
for command in self.commands:
_, out, _ = self.proc(command, "-h")
self.assertIn("Usage", out)