Skip to content

Commit

Permalink
Make 'setup.py test' and 'setup.py trial' work.
Browse files Browse the repository at this point in the history
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
  • Loading branch information
daira committed Apr 11, 2013
1 parent 476e755 commit 64b6a62
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion setup.py
Expand Up @@ -63,6 +63,24 @@
pass

if have_setuptools:
from setuptools import Command

class Trial(Command):
description = "run trial"
user_options = []

def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
from twisted.scripts import trial
sys.argv = ['trial', '--rterrors', 'foolscap.test']
trial.run() # does not return

setup_args['cmdclass'] = {"trial": Trial, "test": Trial}

import platform
if platform.system() == "Windows":
del setup_args["scripts"]
Expand All @@ -71,7 +89,7 @@
"flappserver = foolscap.appserver.cli:run_flappserver",
"flappclient = foolscap.appserver.client:run_flappclient",
] }
setup_args['install_requires'] = ['twisted >= 2.4.0']
setup_args['install_requires'] = setup_args['tests_require'] = ['twisted >= 12.1.0']
# note that pyOpenSSL-0.7 and recent Twisted causes unit test failures,
# see bug #62

Expand Down

0 comments on commit 64b6a62

Please sign in to comment.