Example #1
0
File: setup.py Project: llchan/h5py
    def run(self):
        """ Called by Distutils when this command is run """
        import sys
        py_version = sys.version_info[:2]
        if py_version != (2, 6):
            import unittest
        else:
            try:
                import unittest2 as unittest
            except ImportError:
                raise ImportError(
                    "unittest2 is required to run tests with Python 2.6")

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            result = h5py.run_tests(verbose=self.detail)
            if not result.wasSuccessful():
                sys.exit(1)
        finally:
            sys.path = oldpath
Example #2
0
    def run(self):
        """ Called by Distutils when this command is run """
        import sys

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            sys.exit(h5py.run_tests())
        finally:
            sys.path = oldpath
Example #3
0
    def run(self):
        """ Called by Distutils when this command is run """
        import sys

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            sys.exit(h5py.run_tests())
        finally:
            sys.path = oldpath
Example #4
0
    def run(self):
        """ Called by Distutils when this command is run """
        import sys

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()

        oldpath = sys.path
        oldcwd = os.getcwd()
        build_lib_dir = op.abspath(buildobj.build_lib)
        try:
            sys.path = [build_lib_dir] + oldpath
            os.chdir(build_lib_dir)

            import h5py
            sys.exit(h5py.run_tests())
        finally:
            sys.path = oldpath
            os.chdir(oldcwd)
Example #5
0
    def run(self):
        """ Called by Distutils when this command is run """
        import sys
        py_version = sys.version_info[:2]
        if py_version != (2, 6):
            import unittest
        else:
            try:
                import unittest2 as unittest
            except ImportError:
                raise ImportError( "unittest2 is required to run tests with Python 2.6")

        buildobj = self.distribution.get_command_obj('build')
        buildobj.run()
        
        oldpath = sys.path
        try:
            sys.path = [op.abspath(buildobj.build_lib)] + oldpath
            import h5py
            result = h5py.run_tests(verbose=self.detail)
            if not result.wasSuccessful():
                sys.exit(1)
        finally:
            sys.path = oldpath
Example #6
0
import h5py
h5py.run_tests()
Example #7
0
import h5py._proxy
import h5py.defs
import h5py.h5
import h5py.h5a
import h5py.h5d
import h5py.h5f
import h5py.h5fd
import h5py.h5g
import h5py.h5i
import h5py.h5l
import h5py.h5o
import h5py.h5p
import h5py.h5r
import h5py.h5s
import h5py.h5t
import h5py.h5z
import h5py.utils

# verify that mpi builds are built with mpi
should_have_mpi = os.getenv('mpi', 'nompi') != 'nompi'
have_mpi = h5py.get_config().mpi
assert have_mpi == should_have_mpi, "Expected mpi=%r, got %r" % (
    should_have_mpi, have_mpi)

# skip TestDrivers.test_mpio
import h5py.tests.old.test_file
delattr(h5py.tests.old.test_file.TestDrivers, 'test_mpio')

from sys import exit
exit(0) if h5py.run_tests().wasSuccessful() else exit(1)
Example #8
0
import h5py
import h5py._conv
import h5py._errors
import h5py._objects
import h5py._proxy
import h5py.defs
import h5py.h5
import h5py.h5a
import h5py.h5d
import h5py.h5f
import h5py.h5fd
import h5py.h5g
import h5py.h5i
import h5py.h5l
import h5py.h5o
import h5py.h5p
import h5py.h5r
import h5py.h5s
import h5py.h5t
import h5py.h5z
import h5py.utils

from sys import exit
exit(0) if h5py.run_tests().wasSuccessful() else exit(1)
Example #9
0
import h5py
h5py.run_tests()
Example #10
0
# Run h5py tests
import sys
import h5py
res = h5py.run_tests(verbose=3)
sys.exit(not res.wasSuccessful())
Example #11
0
import h5py._objects
import h5py._proxy
import h5py.defs
import h5py.h5
import h5py.h5a
import h5py.h5d
import h5py.h5f
import h5py.h5fd
import h5py.h5g
import h5py.h5i
import h5py.h5l
import h5py.h5o
import h5py.h5p
import h5py.h5r
import h5py.h5s
import h5py.h5t
import h5py.h5z
import h5py.utils

# verify that mpi builds are built with mpi
should_have_mpi = os.getenv('mpi', 'nompi') != 'nompi'
have_mpi = h5py.get_config().mpi
assert have_mpi == should_have_mpi, "Expected mpi=%r, got %r" % (
    should_have_mpi, have_mpi)

from sys import exit
if have_mpi:
    exit(h5py.run_tests("--with-mpi"))
else:
    exit(h5py.run_tests())
Example #12
0
# Run h5py tests, check for expected filters
from __future__ import print_function
import sys
import h5py

default_filters = set(('shuffle', 'gzip', 'fletcher32', 'scaleoffset'))
szip_filters = default_filters.union(('szip', ))

good = bool(h5py.run_tests(verbose=3))

decode_missing = szip_filters.difference(h5py.filters.decode)
if decode_missing:
    print('Missing decode filters', ' '.join(decode_missing))
    good = False
encode_missing = default_filters.difference(h5py.filters.encode)
if encode_missing:
    print('Missing encode filters', ' '.join(encode_missing))
    good = False
sys.exit(not good)
Example #13
0
import h5py.h5f
import h5py.h5fd
import h5py.h5g
import h5py.h5i
import h5py.h5l
import h5py.h5o
import h5py.h5p
import h5py.h5r
import h5py.h5s
import h5py.h5t
import h5py.h5z
import h5py.utils

import numpy as np

from sys import exit

# test file read/write, regression test for https://github.com/ContinuumIO/anaconda-issues/issues/7686
fh = h5py.File('test.h5', 'w')
fh.create_group('/top')
fh['/top'].attrs['attr1'] = 'Test Attribute 1'
fh['/top'].attrs['attr2'] = 'Test Attribute 2'
fh['/top'].create_dataset('image', data=np.arange(1000)/3.0)
fh.flush()
fh.close()

fh = h5py.File('test.h5', 'r')
fh['/top'].attrs['attr1']

exit(h5py.run_tests())
Example #14
0
# Run h5py tests, check for expected filters
from __future__ import print_function
import sys
import h5py

default_filters = set(('shuffle', 'gzip', 'fletcher32', 'scaleoffset'))
szip_filters = default_filters.union(('szip',))

good = bool(h5py.run_tests(verbose=3))

decode_missing = szip_filters.difference(h5py.filters.decode)
if decode_missing:
    print('Missing decode filters', ' '.join(decode_missing))
    good = False
encode_missing = default_filters.difference(h5py.filters.encode)
if encode_missing:
    print('Missing encode filters', ' '.join(encode_missing))
    good = False
sys.exit(not good)
Example #15
0
def run_h5py_tests(*args, **kwargs):
    import h5py

    h5py.run_tests()