Skip to content

Commit

Permalink
Add test command
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljoseph committed Sep 7, 2013
1 parent 4326591 commit 32307c1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions changes/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ def version(arguments):
execute(['git', 'push'], dry_run=dry_run)


def test(arguments):
dry_run = arguments['--dry-run']
command = 'nosetests'
if arguments['--tox']:
command = 'tox'

return execute([command], dry_run=dry_run)


def changelog(arguments):
dry_run = arguments['--dry-run']
app_name = arguments['<app_name>']
Expand Down Expand Up @@ -238,6 +247,7 @@ def release(arguments):
changes [options] <app_name> changelog
changes [options] <app_name> release
changes [options] <app_name> version
changes [options] <app_name> test
changes [options] <app_name> tag
changes [options] <app_name> upload
Expand All @@ -255,11 +265,13 @@ def release(arguments):
--dry-run Prints the commands that would have been executed.
--skip-changelog For the release task: should the changelog be generated
and committed?
--tox Use tox instead of nosetests
--debug Debug output.
"""


def main():
commands = ['release', 'changelog', 'test', 'version', 'tag', 'upload']
arguments = docopt(cli, version=changes.__version__)
debug = arguments['--debug']
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO)
Expand All @@ -279,5 +291,6 @@ def main():
arguments['new_version'] = new_version
log.debug('arguments: %s', arguments)
for command in ['release', 'version', 'changelog', 'tag', 'upload']:
for command in commands:
if arguments[command]:
globals()[command](arguments)

0 comments on commit 32307c1

Please sign in to comment.