summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2012-03-10 16:03:25 -0800
committerRyan Petrello <lists@ryanpetrello.com>2012-03-10 16:03:25 -0800
commit759bb18a7ed3a203bce544cfefd7fc1d06b5ab9c (patch)
tree633c6235395302a75a4a748bcb0644cfd34b6a02 /setup.py
parent85eb3a45129328608da2792d323a096ad927988c (diff)
downloadpecan-759bb18a7ed3a203bce544cfefd7fc1d06b5ab9c.tar.gz
Changing our tests so that only the fast ones run by default.
Now you can do: Fast ---- $ python setup.py test $ nosetests $ py.test Slow ---- $ python setup.py test --slow
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index fcf03e9..a7d1b27 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
-from setuptools import setup, find_packages
+from setuptools import setup, command, find_packages
+from setuptools.command.test import test as TestCommand
version = '0.1.0'
@@ -26,6 +27,22 @@ except:
tests_require = requirements + ['virtualenv']
+
+class test(TestCommand):
+
+ user_options = TestCommand.user_options + [
+ ('slow', None, 'Run all tests (even the really slow functional ones)')
+ ]
+
+ def initialize_options(self):
+ self.slow = None
+ return TestCommand.initialize_options(self)
+
+ def finalize_options(self):
+ if self.slow:
+ import pecan; setattr(pecan, '__run_all_tests__', True)
+ return TestCommand.finalize_options(self)
+
#
# call setup
#
@@ -60,6 +77,7 @@ setup(
install_requires = requirements,
tests_require = tests_require,
test_suite = 'pecan',
+ cmdclass = {'test' : test},
entry_points = """
[paste.paster_command]
pecan-serve = pecan.commands:ServeCommand