Skip Numpy tests if not installed

This commit is contained in:
Richard Berger 2020-09-17 12:03:36 -04:00
parent 5dacfc47ca
commit 9fa43b8b12
No known key found for this signature in database
GPG Key ID: A9E83994E0BA0CAB
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,13 @@ import sys,os,unittest
from lammps import lammps, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_STYLE_LOCAL, LMP_STYLE_ATOM, LMP_TYPE_VECTOR, LMP_TYPE_SCALAR, LMP_TYPE_ARRAY
from ctypes import c_void_p
try:
import numpy
NUMPY_INSTALLED = True
except ImportError:
NUMPY_INSTALLED = False
@unittest.skipIf(not NUMPY_INSTALLED, "numpy is not available")
class PythonNumpy(unittest.TestCase):
def setUp(self):
machine = None