Skip to content

Commit e8ea631

Browse files
authoredSep 13, 2024··
Merge pull request #1553 from h-mayorquin/make_base_test_setup
Make `BaseTestRawIO` setup per class and not per test
2 parents c4b67c8 + f885833 commit e8ea631

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎neo/test/rawiotest/common_rawio_test.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@ class BaseTestRawIO:
5959

6060
local_test_dir = get_local_testing_data_folder()
6161

62-
def setUp(self):
62+
@classmethod
63+
def setUpClass(cls):
6364
"""
64-
Set up the test fixture. This is run for every test
65+
Set up the test fixture. This is run once before all tests.
6566
"""
66-
self.shortname = self.rawioclass.__name__.lower().replace("rawio", "")
67+
cls.shortname = cls.rawioclass.__name__.lower().replace("rawio", "")
6768

68-
if HAVE_DATALAD and self.use_network:
69-
for remote_path in self.entities_to_download:
69+
if HAVE_DATALAD and cls.use_network:
70+
for remote_path in cls.entities_to_download:
7071
download_dataset(repo=repo_for_test, remote_path=remote_path)
7172
else:
7273
raise unittest.SkipTest("Requires datalad download of data from the web")

‎neo/test/rawiotest/test_maxwellrawio.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import unittest
2-
import os
32

43
from neo.rawio.maxwellrawio import MaxwellRawIO, auto_install_maxwell_hdf5_compression_plugin
54
from neo.test.rawiotest.common_rawio_test import BaseTestRawIO
@@ -9,6 +8,7 @@ class TestMaxwellRawIO(
98
BaseTestRawIO,
109
unittest.TestCase,
1110
):
11+
1212
rawioclass = MaxwellRawIO
1313
entities_to_download = ["maxwell"]
1414
entities_to_test = files_to_test = [
@@ -18,7 +18,6 @@ class TestMaxwellRawIO(
1818

1919
def setUp(self):
2020
auto_install_maxwell_hdf5_compression_plugin(force_download=False)
21-
BaseTestRawIO.setUp(self)
2221

2322

2423
if __name__ == "__main__":

0 commit comments

Comments
 (0)
Please sign in to comment.