Skip to content

Commit

Permalink
Tests: test --help across commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dwaynebailey committed Feb 1, 2016
1 parent dfa0326 commit 7e6deea
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/commands/minus_minus_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.

import pytest

from django.core.management import call_command, get_commands


@pytest.mark.cmd
@pytest.mark.parametrize("command,app", [
(command, app)
for command, app in get_commands().iteritems()
if not app.startswith("django")
])
def test_initdb_help(capfd, command, app):
"""Catch any simple command issues"""
print("Command: %s, App: %s" % (command, app))
with pytest.raises(SystemExit):
call_command(command, '--help')
out, err = capfd.readouterr()
assert '--help' in out

0 comments on commit 7e6deea

Please sign in to comment.