@@ -287,21 +287,29 @@ def test_gap_tolerance_ms_large_tolerance(self):
287287 rawio .parse_header ()
288288 self .assertEqual (rawio ._nb_segment , 1 )
289289
290+ def test_negative_gap_tolerance_ms_raises (self ):
291+ """A negative tolerance would treat every record as a gap, so it is rejected up front."""
292+ with self .assertRaises (ValueError ):
293+ NeuralynxRawIO (
294+ self .get_local_path ("neuralynx/Cheetah_v5.5.1/original_data" ),
295+ gap_tolerance_ms = - 10.0 ,
296+ )
297+
290298 def test_no_gaps_no_error (self ):
291299 """Test that datasets without gaps load fine without gap_tolerance_ms."""
292300 rawio = NeuralynxRawIO (self .get_local_path ("neuralynx/Cheetah_v4.0.2/original_data" ))
293301 rawio .parse_header ()
294302 self .assertEqual (rawio ._nb_segment , 1 )
295303
296304 def test_strict_gap_mode_deprecation (self ):
297- """Test that strict_gap_mode emits DeprecationWarning ."""
298- with self .assertWarns (DeprecationWarning ):
305+ """Test that strict_gap_mode emits FutureWarning ."""
306+ with self .assertWarns (FutureWarning ):
299307 rawio = NeuralynxRawIO (
300308 self .get_local_path ("neuralynx/BML/original_data" ),
301309 strict_gap_mode = True ,
302310 )
303311
304- with self .assertWarns (DeprecationWarning ):
312+ with self .assertWarns (FutureWarning ):
305313 rawio = NeuralynxRawIO (
306314 self .get_local_path ("neuralynx/BML/original_data" ),
307315 strict_gap_mode = False ,
@@ -310,7 +318,7 @@ def test_strict_gap_mode_deprecation(self):
310318 def test_strict_gap_mode_legacy_behavior (self ):
311319 """Test that strict_gap_mode still works for backward compatibility."""
312320 # strict_gap_mode=True should segment like gap_tolerance_ms=0.0
313- with self .assertWarns (DeprecationWarning ):
321+ with self .assertWarns (FutureWarning ):
314322 rawio = NeuralynxRawIO (
315323 self .get_local_path ("neuralynx/Cheetah_v5.5.1/original_data" ),
316324 strict_gap_mode = True ,
@@ -320,7 +328,7 @@ def test_strict_gap_mode_legacy_behavior(self):
320328
321329 def test_strict_gap_mode_false_legacy_behavior (self ):
322330 """The deprecated strict_gap_mode=False (lenient) path still loads, warns, and segments."""
323- with self .assertWarns (DeprecationWarning ):
331+ with self .assertWarns (FutureWarning ):
324332 rawio = NeuralynxRawIO (
325333 self .get_local_path ("neuralynx/Cheetah_v5.5.1/original_data" ),
326334 strict_gap_mode = False ,
0 commit comments