[h5py] 380/455: Fix manual test command

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:52 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.

commit 0aae136bf595a9139a4a0338fad3350bd09c293f
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Sat Feb 6 04:47:55 2010 +0000

    Fix manual test command
---
 h5py/tests/__init__.py | 43 ++++++++++++++++++++++++++++++++++---------
 setup.py               |  2 +-
 2 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/h5py/tests/__init__.py b/h5py/tests/__init__.py
index 9e6e5e4..e262386 100644
--- a/h5py/tests/__init__.py
+++ b/h5py/tests/__init__.py
@@ -16,15 +16,6 @@ import numpy as np
 
 config = h5py.h5.get_config()
 
-def runtests():
-    """ Run low and highlevel h5py tests.
-
-    Result is a 2-tuple of TestResult objects
-    """
-    import low
-    runner = unittest.TextTestRunner()
-    return tuple(runner.run(suite) for suite in (low.getsuite(),))
-
 def autotest():
     try:
         if not all(runtests()):
@@ -152,5 +143,39 @@ class HTest(unittest.TestCase):
         if what is not None:
             raise AssertionError("%r is not None" % what)
 
+def runtests():
+    """ Run low and highlevel h5py tests.
+
+    Result is a 2-tuple of TestResult objects
+    """
+    import os, fnmatch
+    import h5py.tests
+    import h5py.tests.low
+    import h5py.tests.high
+
+    packages = ['low','high']
+    ldr = unittest.TestLoader()
+    suite = unittest.TestSuite()
+
+    thisdir = os.path.dirname(__file__)
+
+    # new tests
+    for p in packages:
+        files = [x.partition('.py')[0] for x in os.listdir(os.path.join(thisdir, p)) if fnmatch.fnmatch(x, 'test_*.py')]
+        modules = ['h5py.tests.%s.%s' % (p, m) for m in files]
+        modules = [__import__(m, fromlist=[h5py.tests, h5py.tests.low, h5py.tests.high]) for m in modules]
+        for m in modules:
+            suite.addTests(ldr.loadTestsFromModule(m))
+
+    # old tests
+        files = [x.partition('.py')[0] for x in os.listdir(thisdir) if fnmatch.fnmatch(x, 'test_*.py')]
+        modules = ['h5py.tests.%s' % m for m in files]
+        modules = [__import__(m, fromlist=[h5py.tests, h5py.tests.low, h5py.tests.high]) for m in modules]
+        for m in modules:
+            suite.addTests(ldr.loadTestsFromModule(m))
+
+    runner = unittest.TextTestRunner()
+    return runner.run(suite)
+
 
 
diff --git a/setup.py b/setup.py
index 4360793..161b623 100644
--- a/setup.py
+++ b/setup.py
@@ -467,7 +467,7 @@ setup(
   maintainer_email = '"h5py" at the domain "alfven.org"',
   url = 'http://h5py.alfven.org',
   download_url = 'http://code.google.com/p/h5py/downloads/list',
-  packages = ['h5py','h5py.tests'],
+  packages = ['h5py','h5py.tests', 'h5py.tests.low', 'h5py.tests.high'],
   package_data = package_data,
   ext_modules = EXTENSIONS,
   requires = ['numpy (>=1.0.1)'],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list