test_suite and tests_require only available when using setuptools

This commit is contained in:
Mathieu Agopian 2012-09-12 11:39:36 +02:00
parent 1492f618cb
commit 7be297cd1e

View file

@ -2,11 +2,16 @@ import sys
ispy3 = sys.version_info[0] == 3 ispy3 = sys.version_info[0] == 3
kwargs = {}
if ispy3: if ispy3:
from distutils.core import setup # NOQA from distutils.core import setup # NOQA
else: else:
try: try:
from setuptools import setup # NOQA from setuptools import setup # NOQA
kwargs = {
'tests_require': ['nose'],
'test_suite': 'nose.collector',
}
except ImportError: except ImportError:
from distutils.core import setup # NOQA from distutils.core import setup # NOQA
@ -33,5 +38,4 @@ setup(
"Topic :: Software Development", "Topic :: Software Development",
"Topic :: Utilities", "Topic :: Utilities",
], ],
tests_require=['nose'], **kwargs)
test_suite='nose.collector',)