diff --git a/CHANGELOG b/CHANGELOG index 6a310bb44..b950a9f47 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,9 @@ Changes between 2.3.1 and 2.3.2.dev - add tox.ini to pytest distribution so that ignore-dirs and others config bits are properly distributed for maintainers who run pytest-own tests +- add some logic to setup.py such that "python setup.py test" works with + pytest itself + Changes between 2.3.0 and 2.3.1 ----------------------------------- diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 723a9dedb..c7bf17ecd 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.3.2.dev1' +__version__ = '2.3.2.dev2' diff --git a/setup.py b/setup.py index 289096813..b8ba3951b 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ import os, sys try: - from setuptools import setup + from setuptools import setup, Command except ImportError: from distribute_setup import use_setuptools use_setuptools() - from setuptools import setup + from setuptools import setup, Command long_description = """ cross-project testing tool for Python. @@ -24,13 +24,14 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.3.2.dev1', + version='2.3.2.dev2', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='Holger Krekel, Benjamin Peterson, Ronny Pfannschmidt, Floris Bruynooghe and others', author_email='holger at merlinux.eu', entry_points= make_entry_points(), + cmdclass = {'test': PyTest}, # the following should be enabled for release install_requires=['py>=1.4.10'], classifiers=['Development Status :: 6 - Mature', @@ -69,5 +70,18 @@ def make_entry_points(): l = ["%s = %s" % (x, points[x]) for x in keys] return {'console_scripts': l} + +class PyTest(Command): + user_options = [] + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + import sys,subprocess + os.environ["PYTHONPATH"] = os.environ["PYTHONPATH"] + ":" + os.getcwd() + errno = subprocess.call([sys.executable, 'pytest.py']) + raise SystemExit(errno) + if __name__ == '__main__': main()