Skip to content

Commit

Permalink
Sort sessions in SessionMnager.list_sessions()
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Aug 8, 2017
1 parent b7a296c commit a20f017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qutebrowser/misc/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def list_sessions(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/misc/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def test_with_sessions(self, tmpdir):
(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()
Expand Down

0 comments on commit a20f017

Please sign in to comment.