From 6eafc2ad3dc02b9586bee78c5de84d289d70b3c2 Mon Sep 17 00:00:00 2001 From: John Evans Date: Mon, 24 Jun 2013 08:54:08 -0400 Subject: [PATCH] Added runtests function to discover and run tests from within python. --- glymur/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glymur/__init__.py b/glymur/__init__.py index 79fcc5e..43ca2b3 100644 --- a/glymur/__init__.py +++ b/glymur/__init__.py @@ -1,9 +1,15 @@ """glymur - read, write, and interrogate JPEG 2000 files """ - from .jp2k import Jp2k from .jp2dump import jp2dump from . import data from . import test + +def runtests(): + """Discover and run all tests for the glymur package. + """ + import unittest + suite = unittest.defaultTestLoader.discover(__path__[0]) + unittest.TextTestRunner(verbosity=2).run(suite)