Commit 1e8ce667 authored by Theo Steininger's avatar Theo Steininger
Browse files

Inserted check in test/test_serialization.py if h5py is available.

parent c31c7198
Pipeline #10846 passed with stage
in 19 minutes and 1 second
import unittest
from nifty import dependency_injector as di
from numpy.testing import assert_equal
from keepers import Repository
from test.common import expand, generate_spaces
try:
import h5py
except ImportError:
h5py_available = False
else:
h5py_available = True
class SpaceSerializationTests(unittest.TestCase):
# variable to hold the repository
_repo = None
if h5py_available:
class SpaceSerializationTests(unittest.TestCase):
# variable to hold the repository
_repo = None
@classmethod
def setUpClass(cls):
cls._repo = Repository('test.h5')
@classmethod
def setUpClass(cls):
cls._repo = Repository('test.h5')
@expand([[space] for space in generate_spaces()])
def test_serialization(self, space):
self._repo.add(space, 'space')
self._repo.commit()
@expand([[space] for space in generate_spaces()])
def test_serialization(self, space):
self._repo.add(space, 'space')
self._repo.commit()
assert_equal(space, self._repo.get('space'))
assert_equal(space, self._repo.get('space'))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment