From 3fa21e128a7178495ac3935229aa18de41e6539d Mon Sep 17 00:00:00 2001 From: Shruti Bhale Date: Thu, 18 Dec 2025 21:56:03 +0530 Subject: [PATCH 1/2] MAINT: Use f-strings in test_import_nesting.py --- mne/tests/test_import_nesting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mne/tests/test_import_nesting.py b/mne/tests/test_import_nesting.py index 6904e9ff755..72cc646f370 100644 --- a/mne/tests/test_import_nesting.py +++ b/mne/tests/test_import_nesting.py @@ -242,7 +242,7 @@ def generic_visit(self, node): and sys.modules[x] is not None) bad = scipy_submodules - ok_scipy_submodules if len(bad) > 0: - out |= {'scipy submodules: %s' % list(bad)} + out |= {f'scipy submodules: {list(bad)}'} # check sklearn and others for x in sys.modules.keys(): @@ -253,7 +253,7 @@ def generic_visit(self, node): x = '.'.join(x.split('.')[:2]) out |= {x} if len(out) > 0: - print('\\nFound un-nested import(s) for %s' % (sorted(out),), end='') + print(f'\\nFound un-nested import(s) for {sorted(out)}', end='') exit(len(out)) # but this should still work From 9fbc4f617d0395952b811c60b355f22f674bc04a Mon Sep 17 00:00:00 2001 From: Shruti Bhale Date: Sat, 20 Dec 2025 19:29:59 +0530 Subject: [PATCH 2/2] DOC: Add changelog entry --- doc/changes/dev/13551.other.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/dev/13551.other.rst diff --git a/doc/changes/dev/13551.other.rst b/doc/changes/dev/13551.other.rst new file mode 100644 index 00000000000..03f241cde12 --- /dev/null +++ b/doc/changes/dev/13551.other.rst @@ -0,0 +1 @@ +- Refactor f-strings in ``mne/tests/test_import_nesting.py`` (:gh:`13551` by :newcontrib:`shruti423`). \ No newline at end of file