|
7 | 7 | from spikeinterface.core.core_tools import SIJsonEncoder |
8 | 8 | from spikeinterface.core.generate import generate_recording, generate_sorting |
9 | 9 |
|
10 | | - |
11 | | -@pytest.fixture(scope="module") |
12 | | -def numpy_generated_recording(): |
13 | | - recording = generate_recording() |
14 | | - return recording |
| 10 | +from pathlib import Path |
15 | 11 |
|
16 | 12 |
|
17 | 13 | @pytest.fixture(scope="module") |
@@ -124,8 +120,25 @@ def test_numpy_dtype_alises_encoding(): |
124 | 120 | json.dumps(np.float32, cls=SIJsonEncoder) |
125 | 121 |
|
126 | 122 |
|
127 | | -def test_recording_encoding(numpy_generated_recording): |
128 | | - recording = numpy_generated_recording |
| 123 | +def test_path_encoding(tmp_path): |
| 124 | + |
| 125 | + temporary_path = tmp_path / "a_path_for_this_test" |
| 126 | + |
| 127 | + json.dumps(temporary_path, cls=SIJsonEncoder) |
| 128 | + |
| 129 | + |
| 130 | +def test_path_as_annotation(tmp_path): |
| 131 | + temporary_path = tmp_path / "a_path_for_this_test" |
| 132 | + |
| 133 | + recording = generate_recording() |
| 134 | + recording.annotate(path=temporary_path) |
| 135 | + |
| 136 | + json.dumps(recording, cls=SIJsonEncoder) |
| 137 | + |
| 138 | + |
| 139 | +def test_recording_encoding(): |
| 140 | + recording = generate_recording() |
| 141 | + |
129 | 142 | json.dumps(recording, cls=SIJsonEncoder) |
130 | 143 |
|
131 | 144 |
|
@@ -200,4 +213,4 @@ def test_encoding_numpy_scalars_within_nested_extractors_dict(nested_extractor_d |
200 | 213 |
|
201 | 214 | if __name__ == "__main__": |
202 | 215 | nested_extractor = nested_extractor() |
203 | | - test_encoding_numpy_scalars_within_nested_extractors(nested_extractor_) |
| 216 | + test_encoding_numpy_scalars_within_nested_extractors(nested_extractor) |
0 commit comments