def test_unknown_output(self): # Avoid the help message on stdout with captured_output() as (stdout, stderr): with self.assertRaises(SystemExit): cli.parse_args([ "--output", "foo", "mem://some/schema", ]) self.assertIn("invalid choice: 'foo'", stderr.getvalue()) self.assertFalse(stdout.getvalue())
def test_useless_error_format(self): # Avoid the help message on stdout with captured_output() as (stdout, stderr): with self.assertRaises(SystemExit): cli.parse_args([ "--output", "pretty", "--error-format", "foo", "mem://some/schema", ]) self.assertIn( "--error-format can only be used with --output plain", stderr.getvalue(), ) self.assertFalse(stdout.getvalue())