diff --git a/qutebrowser/misc/sessions.py b/qutebrowser/misc/sessions.py index 0a4fae5b7..54ba35014 100644 --- a/qutebrowser/misc/sessions.py +++ b/qutebrowser/misc/sessions.py @@ -426,7 +426,7 @@ class SessionManager(QObject): base, ext = os.path.splitext(filename) if ext == '.yml': sessions.append(base) - return sessions + return sorted(sessions) @cmdutils.register(instance='session-manager') @cmdutils.argument('name', completion=miscmodels.session) diff --git a/tests/unit/misc/test_sessions.py b/tests/unit/misc/test_sessions.py index 00311ec8e..236d695c1 100644 --- a/tests/unit/misc/test_sessions.py +++ b/tests/unit/misc/test_sessions.py @@ -372,7 +372,7 @@ class TestListSessions: (tmpdir / 'foo.yml').ensure() (tmpdir / 'bar.yml').ensure() sess_man = sessions.SessionManager(str(tmpdir)) - assert sorted(sess_man.list_sessions()) == ['bar', 'foo'] + assert sess_man.list_sessions() == ['bar', 'foo'] def test_with_other_files(self, tmpdir): (tmpdir / 'foo.yml').ensure()