diff --git a/qutebrowser/app.py b/qutebrowser/app.py index dd73827af..0f95c1c5d 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -83,6 +83,9 @@ def run(args): standarddir.init(args) if args.version: + # we need to init sql to print the sql version + # we can use an in-memory database as we just want to query the version + sql.init('') print(version.version()) sys.exit(usertypes.Exit.ok) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index faa890152..a408ce1fd 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -326,11 +326,7 @@ def version(): lines += _module_versions() lines += ['pdf.js: {}'.format(_pdfjs_version())] - - # we can use an in-memory database as we just want to query the version - sql.init('') lines += ['sqlite: {}'.format(sql.version())] - sql.close() lines += [ 'SSL: {}'.format(QSslSocket.sslLibraryVersionString()), diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 279df7808..f6c5ce84a 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -702,3 +702,11 @@ Feature: Various utility commands. And I wait for "Renderer process was killed" in the log And I open data/numbers/3.txt Then no crash should happen + And the following tabs should be open: + - data/numbers/3.txt (active) + + ## Other + + Scenario: Open qute://version + When I open qute://version + Then the page should contain the plaintext "Version info" diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 8c0f16081..c0c731f88 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -809,7 +809,7 @@ def test_chromium_version_unpatched(qapp): (True, False, True, True, False), # unknown Linux distribution ]) def test_version_output(git_commit, frozen, style, with_webkit, - known_distribution, stubs, monkeypatch): + known_distribution, stubs, monkeypatch, init_sql): """Test version.version().""" class FakeWebEngineProfile: def httpUserAgent(self):