173173
174174def _assert_n_free (raw_sss , lower , upper = None ):
175175 """Check the DOF."""
176+ __tracebackhide__ = True
176177 upper = lower if upper is None else upper
177178 n_free = raw_sss .info ["proc_history" ][0 ]["max_info" ]["sss_info" ]["nfree" ]
178179 assert lower <= n_free <= upper , f"nfree fail: { lower } <= { n_free } <= { upper } "
@@ -367,10 +368,9 @@ def test_other_systems():
367368 hsp_path = kit_dir / "test_hsp.txt"
368369 raw_kit = read_raw_kit (sqd_path , str (mrk_path ), str (elp_path ), str (hsp_path ))
369370 with (
370- pytest .warns (RuntimeWarning , match = "more than 20 mm from head frame origin" ),
371371 pytest .raises (NotImplementedError , match = "Cannot create forward solution with" ),
372372 ):
373- maxwell_filter (raw_kit )
373+ maxwell_filter (raw_kit , verbose = True )
374374 with catch_logging () as log :
375375 raw_sss = maxwell_filter (
376376 raw_kit , origin = (0.0 , 0.0 , 0.04 ), ignore_ref = True , verbose = True
@@ -381,24 +381,21 @@ def test_other_systems():
381381 raw_kit , origin = (0.0 , 0.0 , 0.04 ), ignore_ref = True , mag_scale = "auto"
382382 )
383383 assert_allclose (raw_sss ._data , raw_sss_auto ._data )
384- # The KIT origin fit is terrible
385- with pytest .warns (RuntimeWarning , match = "more than 20 mm" ):
386- with catch_logging () as log :
387- pytest .raises (
388- RuntimeError , maxwell_filter , raw_kit , ignore_ref = True , regularize = None
389- ) # bad condition
390- raw_sss = maxwell_filter (
391- raw_kit ,
392- origin = "auto" ,
393- ignore_ref = True ,
394- bad_condition = "info" ,
395- verbose = True ,
396- )
384+ with catch_logging () as log :
385+ pytest .raises (
386+ RuntimeError , maxwell_filter , raw_kit , ignore_ref = True , regularize = None
387+ ) # bad condition
388+ raw_sss = maxwell_filter (
389+ raw_kit ,
390+ origin = "auto" ,
391+ ignore_ref = True ,
392+ bad_condition = "info" ,
393+ verbose = True ,
394+ )
397395 log = log .getvalue ()
398- assert "badly conditioned" in log
399- assert "more than 20 mm from" in log
400- # fits can differ slightly based on scipy version, so be lenient here
401- _assert_n_free (raw_sss , 28 , 34 ) # bad origin == brutal reg
396+ assert "badly conditioned" not in log
397+ assert "more than 20 mm from" not in log
398+ _assert_n_free (raw_sss , 67 , 67 )
402399 # Let's set the origin
403400 with catch_logging () as log :
404401 raw_sss = maxwell_filter (
0 commit comments