|
1 | 1 | import platform |
2 | 2 | import json |
3 | | -import pytest |
4 | 3 | from unittest import TestCase |
5 | 4 | from packaging import version |
6 | 5 |
|
@@ -229,28 +228,34 @@ def test_check_single_row_pass(): |
229 | 228 |
|
230 | 229 |
|
231 | 230 | def test_check_single_row_ignore_units(): |
232 | | - table = Units( |
233 | | - name="Units", |
234 | | - ) # default name when building through nwbfile |
| 231 | + table = Units(name="Units",) # default name when building through nwbfile |
235 | 232 | table.add_unit(spike_times=[1, 2, 3]) |
236 | 233 | assert check_single_row(table=table) is None |
237 | 234 |
|
238 | 235 |
|
239 | | -@pytest.mark.skipif(get_package_version(name="pynwb") >= version.Version("2.1.0")) # TODO: remove skip when fixed |
240 | 236 | def test_check_single_row_ignore_electrodes(): |
241 | | - table = ElectrodeTable( |
242 | | - name="electrodes", |
243 | | - ) # default name when building through nwbfile |
244 | | - table.add_row( |
245 | | - x=np.nan, |
246 | | - y=np.nan, |
247 | | - z=np.nan, |
248 | | - imp=np.nan, |
249 | | - location="unknown", |
250 | | - filtering="unknown", |
251 | | - group=ElectrodeGroup(name="test_group", description="", device=Device(name="test_device"), location="unknown"), |
252 | | - group_name="test_group", |
253 | | - ) |
| 237 | + table = ElectrodeTable(name="electrodes",) # default name when building through nwbfile |
| 238 | + if get_package_version(name="pynwb") >= version.Version("2.1.0"): |
| 239 | + table.add_row( |
| 240 | + location="unknown", |
| 241 | + group=ElectrodeGroup( |
| 242 | + name="test_group", description="", device=Device(name="test_device"), location="unknown" |
| 243 | + ), |
| 244 | + group_name="test_group", |
| 245 | + ) |
| 246 | + else: |
| 247 | + table.add_row( |
| 248 | + x=np.nan, |
| 249 | + y=np.nan, |
| 250 | + z=np.nan, |
| 251 | + imp=np.nan, |
| 252 | + location="unknown", |
| 253 | + filtering="unknown", |
| 254 | + group=ElectrodeGroup( |
| 255 | + name="test_group", description="", device=Device(name="test_device"), location="unknown" |
| 256 | + ), |
| 257 | + group_name="test_group", |
| 258 | + ) |
254 | 259 | assert check_single_row(table=table) is None |
255 | 260 |
|
256 | 261 |
|
|
0 commit comments