Skip to content

Commit

Permalink
Add -v and -s options to setup.py test command
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrv committed Jan 5, 2014
1 parent 73089d4 commit 7e12677
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@


class PyTest(Command):
user_options = []
description = 'Run unit tests'

user_options = [('test-verbose', 'v', 'test verbose'),
('no-capture', 's', 'disable output capturing')]

def initialize_options(self):
pass
self.test_verbose = None
self.no_capture = None

def finalize_options(self):
pass

def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
cmd = [sys.executable, 'runtests.py']
if self.test_verbose:
cmd.append('-v')
if self.no_capture:
cmd.append('-s')
errno = subprocess.call(cmd)
raise SystemExit(errno)


Expand Down

0 comments on commit 7e12677

Please sign in to comment.