@@ -1267,7 +1267,12 @@ def test_return_root_paths_entity_aware(tmp_path):
12671267 assert len (all_paths ) >= 2
12681268
12691269 # Entity-aware scan for subjA should only return files under sub-subjA
1270- subj_paths = _return_root_paths (root_str , datatype = ("meg" , "eeg" ), ignore_json = True , entities = {"subject" : "subjA" })
1270+ subj_paths = _return_root_paths (
1271+ root_str ,
1272+ datatype = ("meg" , "eeg" ),
1273+ ignore_json = True ,
1274+ entities = {"subject" : "subjA" },
1275+ )
12711276 assert len (subj_paths ) < len (all_paths )
12721277 assert all ("sub-subjA" in str (p ) for p in subj_paths )
12731278
@@ -1303,18 +1308,32 @@ def fake_iglob(pattern, root_dir=None, recursive=False):
13031308
13041309 def fake_filter (paths , ignore_json ):
13051310 # convert returned strings into Path objects rooted at fake_root
1306- return [Path (fake_root , p ) for p in fake_results if (not ignore_json ) or (not p .endswith ('.json' ))]
1311+ return [
1312+ Path (fake_root , p )
1313+ for p in fake_results
1314+ if (not ignore_json ) or (not p .endswith (".json" ))
1315+ ]
13071316
13081317 monkeypatch .setattr (mb_path , "_filter_paths_optimized" , fake_filter )
13091318
13101319 # ignore_json=True should filter out the .json entry
1311- paths = _return_root_paths (fake_root , datatype = ("meg" , "eeg" ), ignore_json = True , entities = {"subject" : "subjA" })
1320+ paths = _return_root_paths (
1321+ fake_root ,
1322+ datatype = ("meg" , "eeg" ),
1323+ ignore_json = True ,
1324+ entities = {"subject" : "subjA" },
1325+ )
13121326 assert all (isinstance (p , Path ) for p in paths )
13131327 # only the .fif entry for subjA should remain
13141328 assert any (p .suffix == ".fif" and "sub-subjA" in str (p ) for p in paths )
13151329
13161330 # ignore_json=False should include the .json entry
1317- paths_all = _return_root_paths (fake_root , datatype = ("meg" , "eeg" ), ignore_json = False , entities = {"subject" : "subjA" })
1331+ paths_all = _return_root_paths (
1332+ fake_root ,
1333+ datatype = ("meg" , "eeg" ),
1334+ ignore_json = False ,
1335+ entities = {"subject" : "subjA" },
1336+ )
13181337 assert any (str (p ).endswith (".json" ) for p in paths_all )
13191338
13201339
0 commit comments