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 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