From f22dc90da0b36b24267611a69321fba64c051763 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Mon, 2 Jan 2017 19:41:12 -0500 Subject: [PATCH 1/2] Modernize tests --- cxotime/__init__.py | 8 ++++++++ setup.py | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cxotime/__init__.py b/cxotime/__init__.py index 4ea5cb2..bc6059c 100644 --- a/cxotime/__init__.py +++ b/cxotime/__init__.py @@ -1,3 +1,11 @@ from .cxotime import CxoTime __version__ = '0.1' + + +def test(*args, **kwargs): + ''' + Run py.test unit tests. + ''' + import testr + return testr.test(*args, **kwargs) diff --git a/setup.py b/setup.py index 2020a55..de4d037 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,18 @@ from cxotime import __version__ +try: + from testr.setup_helper import cmdclass +except ImportError: + cmdclass = {} + setup(name='cxotime', author='Tom Aldcroft', description='Chandra Time class base on astropy Time', author_email='taldcroft@cfa.harvard.edu', version=__version__, - packages=['cxotime'], + zip_safe=False, + packages=['cxotime', 'cxotime.tests'], + tests_require=['pytest'], + cmdclass=cmdclass, ) From e8f928d6a1fb50089fd1918edbe249a15a9abc2b Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Mon, 2 Jan 2017 19:41:27 -0500 Subject: [PATCH 2/2] Update version to 3.1 --- cxotime/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxotime/__init__.py b/cxotime/__init__.py index bc6059c..3b5b7e3 100644 --- a/cxotime/__init__.py +++ b/cxotime/__init__.py @@ -1,6 +1,6 @@ from .cxotime import CxoTime -__version__ = '0.1' +__version__ = '3.1' def test(*args, **kwargs):