__init__.py 613 B

123456789101112131415161718192021
  1. # This file is part of h5py, a Python interface to the HDF5 library.
  2. #
  3. # http://www.h5py.org
  4. #
  5. # Copyright 2008-2013 Andrew Collette and contributors
  6. #
  7. # License: Standard 3-clause BSD; see "license.txt" for full license terms
  8. # and contributor agreement.
  9. import sys
  10. import shlex
  11. from importlib.util import find_spec
  12. from subprocess import call
  13. def run_tests(args=''):
  14. if find_spec("pytest") is None:
  15. print("Tests require pytest, pytest not installed")
  16. return 1
  17. cli = [sys.executable, "-m", "pytest", "--pyargs", "h5py"]
  18. cli.extend(shlex.split(args))
  19. return call(cli)