aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorXavier Ordoquy2014-04-17 09:53:44 +0200
committerXavier Ordoquy2014-04-17 09:53:44 +0200
commit1797a74e828c9fdfbfb46bb4de049100b18db875 (patch)
treea91e8f4ff22e8eb63a990a439995632e9198d1c3 /setup.py
parent1d404874b3f0f5b16f3b38ba322f31a18c41aad6 (diff)
parent971578ca345c3d3bae7fd93b87c41d43483b6f05 (diff)
downloaddjango-rest-framework-1797a74e828c9fdfbfb46bb4de049100b18db875.tar.bz2
Merge remote-tracking branch 'pelme/pytest' into feature/pytest
Conflicts: .travis.yml rest_framework/runtests/runtests.py tests/test_filters.py tests/test_pagination.py tox.ini
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 78cdb628..2c56cd75 100755
--- a/setup.py
+++ b/setup.py
@@ -2,11 +2,26 @@
# -*- coding: utf-8 -*-
from setuptools import setup
+from setuptools.command.test import test as TestCommand
import re
import os
import sys
+# This command has been borrowed from
+# https://github.com/getsentry/sentry/blob/master/setup.py
+class PyTest(TestCommand):
+ def finalize_options(self):
+ TestCommand.finalize_options(self)
+ self.test_args = ['tests']
+ self.test_suite = True
+
+ def run_tests(self):
+ import pytest
+ errno = pytest.main(self.test_args)
+ sys.exit(errno)
+
+
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
@@ -62,7 +77,7 @@ setup(
author_email='tom@tomchristie.com', # SEE NOTE BELOW (*)
packages=get_packages('rest_framework'),
package_data=get_package_data('rest_framework'),
- test_suite='rest_framework.runtests.runtests.main',
+ cmdclass={'test': PyTest},
install_requires=[],
classifiers=[
'Development Status :: 5 - Production/Stable',