Skip to content

Commit 7a1cd85

Browse files
committed
Skip tests if MEArec is not installed
1 parent 142ad67 commit 7a1cd85

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

neo/test/iotest/test_mearecio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
from neo.test.iotest.common_io_test import BaseTestIO
99

1010

11+
try:
12+
import MEArec as mr
13+
HAVE_MEAREC = True
14+
except ImportError:
15+
HAVE_MEAREC = False
16+
17+
18+
@unittest.skipUnless(HAVE_MEAREC, "requires MEArec package")
1119
class TestMEArecIO(BaseTestIO, unittest.TestCase):
1220
files_to_test = ['mearec_test_10s.h5']
1321
files_to_download = ['mearec_test_10s.h5']

neo/test/rawiotest/test_mearecrawio.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
from neo.test.rawiotest.common_rawio_test import BaseTestRawIO
1111

1212

13+
try:
14+
import MEArec as mr
15+
HAVE_MEAREC = True
16+
except ImportError:
17+
HAVE_MEAREC = False
18+
19+
20+
@unittest.skipUnless(HAVE_MEAREC, "requires MEArec package")
1321
class TestMEArecRawIO(BaseTestRawIO, unittest.TestCase, ):
1422
rawioclass = MEArecRawIO
1523
files_to_download = ['mearec_test_10s.h5']

0 commit comments

Comments
 (0)