From c00f33e62d9f300dff8b42fb251e4b0607ee0571 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Wed, 18 Dec 2013 10:06:22 +0100 Subject: [PATCH] Support for `python setup.py test` to run the tox suite. --- CHANGELOG | 1 + setup.py | 22 +++++++++++++++++++++- tox.ini | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b9da6c0..7a43687 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ dpaste Changelog * Windows users can submit the form using Ctrl+Enter * The raw view now sends the X-Content-Type-Options=nosniff header * Various constants can now be overridden by settings +* Support for `python setup.py test` to run the tox suite 2.1 (2013-12-14) ---------------- diff --git a/setup.py b/setup.py index fe4c940..68d2ba0 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,19 @@ #!/usr/bin/env python from setuptools import setup, find_packages +from setuptools.command.test import test as TestCommand +from sys import exit + +class Tox(TestCommand): + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True + + def run_tests(self): + #import here, cause outside the eggs aren't loaded + import tox + errno = tox.cmdline(self.test_args) + exit(errno) setup( name='dpaste', @@ -28,5 +42,11 @@ setup( 'django-mptt>=0.6.0', 'pygments>=1.6', 'requests>=2.0.0', - ] + ], + tests_require=[ + 'tox==1.6.1' + ], + cmdclass={ + 'test': Tox + }, ) diff --git a/tox.ini b/tox.ini index 9ee390b..605541c 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ deps=django==1.4.10 deps=django==1.5.5 [testenv:py27-django-1.6] -deps=django==1.6 +deps=django==1.6.1 [testenv:py33-django-1.6] -deps=django==1.6 +deps=django==1.6.1