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 10 11def run_tests(args=''): 12 try: 13 from pytest import main 14 except ImportError: 15 print("Tests require pytest, pytest not installed") 16 return 1 17 else: 18 from shlex import split 19 from subprocess import call 20 from sys import executable 21 cli = [executable, "-m", "pytest", "--pyargs", "h5py"] 22 cli.extend(split(args)) 23 return call(cli) 24