Skip to content

Commit 0d845e0

Browse files
elpransJames William Pye
authored andcommitted
Add test command to setup.py
1 parent 5c82084 commit 0d845e0

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

postgresql/release/distutils.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
import os
1515
from ..project import version, name, identity as url
16-
from distutils.core import Extension
16+
from distutils.core import Extension, Command
1717

1818
LONG_DESCRIPTION = """
1919
py-postgresql is a set of Python modules providing interfaces to various parts
@@ -172,7 +172,25 @@ def standard_setup_keywords(build_extensions = True, prefix = default_prefix):
172172
'classifiers' : CLASSIFIERS,
173173
'packages' : list(prefixed_packages(prefix = prefix)),
174174
'package_data' : dict(prefixed_package_data(prefix = prefix)),
175+
'cmdclass': dict(test=TestCommand),
175176
}
176177
if build_extensions:
177178
d['ext_modules'] = list(prefixed_extensions(prefix = prefix))
178179
return d
180+
181+
class TestCommand(Command):
182+
description = "run tests"
183+
184+
# List of option tuples: long name, short name (None if no short
185+
# name), and help string.
186+
user_options = []
187+
188+
def initialize_options(self):
189+
pass
190+
191+
def finalize_options(self):
192+
pass
193+
194+
def run(self):
195+
import unittest
196+
unittest.main(module='postgresql.test.testall', argv=('setup.py',))

0 commit comments

Comments
 (0)