diff --git a/IPython/core/history.py b/IPython/core/history.py index f247f71..1a89060 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -361,8 +361,9 @@ class HistoryAccessor(HistoryAccessorBase): self.writeout_cache() if not include_latest: n += 1 - cur = self._run_sql("ORDER BY session DESC, line DESC LIMIT ?", - (n,), raw=raw, output=output) + cur = self._run_sql( + "ORDER BY session DESC, line DESC LIMIT ?", (n,), raw=raw, output=output + ) if not include_latest: return reversed(list(cur)[1:]) return reversed(list(cur)) diff --git a/IPython/core/tests/test_history.py b/IPython/core/tests/test_history.py index b98ef76..46c0ea8 100644 --- a/IPython/core/tests/test_history.py +++ b/IPython/core/tests/test_history.py @@ -228,11 +228,12 @@ def test_histmanager_disabled(): # hist_file should not be created assert hist_file.exists() is False + def test_get_tail_session_awareness(): """Test .get_tail() is: - - session specific in HistoryManager - - session agnostic in HistoryAccessor - same for .get_last_session_id() + - session specific in HistoryManager + - session agnostic in HistoryAccessor + same for .get_last_session_id() """ ip = get_ipython() with TemporaryDirectory() as tmpdir: