Remove environment variables from version()
We already have those in the report anyways.
This commit is contained in:
parent
8403f2451f
commit
44e8296a66
@ -237,7 +237,6 @@ def version():
|
|||||||
lines.append('Webkit: {}'.format(qWebKitVersion()))
|
lines.append('Webkit: {}'.format(qWebKitVersion()))
|
||||||
|
|
||||||
lines += [
|
lines += [
|
||||||
'Harfbuzz: {}'.format(os.environ.get('QT_HARFBUZZ', 'system')),
|
|
||||||
'SSL: {}'.format(QSslSocket.sslLibraryVersionString()),
|
'SSL: {}'.format(QSslSocket.sslLibraryVersionString()),
|
||||||
'',
|
'',
|
||||||
]
|
]
|
||||||
@ -252,7 +251,6 @@ def version():
|
|||||||
lines += [
|
lines += [
|
||||||
'Platform: {}, {}'.format(platform.platform(),
|
'Platform: {}, {}'.format(platform.platform(),
|
||||||
platform.architecture()[0]),
|
platform.architecture()[0]),
|
||||||
'Desktop: {}'.format(os.environ.get('DESKTOP_SESSION')),
|
|
||||||
'Frozen: {}'.format(hasattr(sys, 'frozen')),
|
'Frozen: {}'.format(hasattr(sys, 'frozen')),
|
||||||
"Imported from {}".format(importpath),
|
"Imported from {}".format(importpath),
|
||||||
]
|
]
|
||||||
|
@ -614,18 +614,17 @@ class FakeQSslSocket:
|
|||||||
return self._version
|
return self._version
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(['git_commit', 'harfbuzz', 'frozen', 'style',
|
@pytest.mark.parametrize(['git_commit', 'frozen', 'style',
|
||||||
'equal_qt', 'with_webkit'], [
|
'equal_qt', 'with_webkit'], [
|
||||||
(True, True, False, True, True, True), # normal
|
(True, False, True, True, True), # normal
|
||||||
(False, True, False, True, True, True), # no git commit
|
(False, False, True, True, True), # no git commit
|
||||||
(True, False, False, True, True, True), # HARFBUZZ unset
|
(True, True, True, True, True), # frozen
|
||||||
(True, True, True, True, True, True), # frozen
|
(True, True, False, True, True), # no style
|
||||||
(True, True, True, False, True, True), # no style
|
(True, False, True, False, True), # different Qt
|
||||||
(True, True, False, True, False, True), # different Qt
|
(True, False, True, True, False), # no webkit
|
||||||
(True, True, False, True, True, False), # no webkit
|
|
||||||
])
|
])
|
||||||
def test_version_output(git_commit, harfbuzz, frozen, style, equal_qt,
|
def test_version_output(git_commit, frozen, style, equal_qt, with_webkit,
|
||||||
with_webkit, stubs, monkeypatch):
|
stubs, monkeypatch):
|
||||||
"""Test version.version()."""
|
"""Test version.version()."""
|
||||||
import_path = os.path.abspath('/IMPORTPATH')
|
import_path = os.path.abspath('/IMPORTPATH')
|
||||||
patches = {
|
patches = {
|
||||||
@ -652,13 +651,6 @@ def test_version_output(git_commit, harfbuzz, frozen, style, equal_qt,
|
|||||||
for attr, val in patches.items():
|
for attr, val in patches.items():
|
||||||
monkeypatch.setattr('qutebrowser.utils.version.' + attr, val)
|
monkeypatch.setattr('qutebrowser.utils.version.' + attr, val)
|
||||||
|
|
||||||
monkeypatch.setenv('DESKTOP_SESSION', 'DESKTOP')
|
|
||||||
|
|
||||||
if harfbuzz:
|
|
||||||
monkeypatch.setenv('QT_HARFBUZZ', 'HARFBUZZ')
|
|
||||||
else:
|
|
||||||
monkeypatch.delenv('QT_HARFBUZZ', raising=False)
|
|
||||||
|
|
||||||
if frozen:
|
if frozen:
|
||||||
monkeypatch.setattr(sys, 'frozen', True, raising=False)
|
monkeypatch.setattr(sys, 'frozen', True, raising=False)
|
||||||
else:
|
else:
|
||||||
@ -675,11 +667,9 @@ def test_version_output(git_commit, harfbuzz, frozen, style, equal_qt,
|
|||||||
MODULE VERSION 2
|
MODULE VERSION 2
|
||||||
pdf.js: PDFJS VERSION
|
pdf.js: PDFJS VERSION
|
||||||
Webkit: {webkit}
|
Webkit: {webkit}
|
||||||
Harfbuzz: {harfbuzz}
|
|
||||||
SSL: SSL VERSION
|
SSL: SSL VERSION
|
||||||
{style}
|
{style}
|
||||||
Platform: PLATFORM, ARCHITECTURE
|
Platform: PLATFORM, ARCHITECTURE
|
||||||
Desktop: DESKTOP
|
|
||||||
Frozen: {frozen}
|
Frozen: {frozen}
|
||||||
Imported from {import_path}
|
Imported from {import_path}
|
||||||
OS INFO 1
|
OS INFO 1
|
||||||
@ -691,7 +681,6 @@ def test_version_output(git_commit, harfbuzz, frozen, style, equal_qt,
|
|||||||
'style': '\nStyle: STYLE' if style else '',
|
'style': '\nStyle: STYLE' if style else '',
|
||||||
'qt': ('QT VERSION' if equal_qt else
|
'qt': ('QT VERSION' if equal_qt else
|
||||||
'QT RUNTIME VERSION (compiled QT VERSION)'),
|
'QT RUNTIME VERSION (compiled QT VERSION)'),
|
||||||
'harfbuzz': 'HARFBUZZ' if harfbuzz else 'system',
|
|
||||||
'frozen': str(frozen),
|
'frozen': str(frozen),
|
||||||
'import_path': import_path,
|
'import_path': import_path,
|
||||||
'webkit': 'WEBKIT VERSION' if with_webkit else 'no'
|
'webkit': 'WEBKIT VERSION' if with_webkit else 'no'
|
||||||
|
Loading…
Reference in New Issue
Block a user