diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 923c962f8..6975ba5fa 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -162,7 +162,7 @@ def _os_info(): lines = [] releaseinfo = None if sys.platform == 'linux': - osver = ', '.join([e for e in platform.linux_distribution() if e]) + osver = '' releaseinfo = _release_info() elif sys.platform == 'win32': osver = ', '.join(platform.win32_ver()) diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index f43ae6d8f..ed6dda906 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -451,25 +451,16 @@ class TestOsInfo: """Tests for _os_info.""" - @pytest.mark.parametrize('dist, dist_str', [ - (('x', '', 'y'), 'x, y'), - (('a', 'b', 'c'), 'a, b, c'), - (('', '', ''), ''), - ]) - def test_linux_fake(self, monkeypatch, dist, dist_str): + def test_linux_fake(self, monkeypatch): """Test with a fake Linux. - Args: - dist: The value to set platform.linux_distribution() to. - dist_str: The expected distribution string in version._os_info(). + No args because osver is set to '' if the OS is linux. """ monkeypatch.setattr('qutebrowser.utils.version.sys.platform', 'linux') monkeypatch.setattr('qutebrowser.utils.version._release_info', lambda: [('releaseinfo', 'Hello World')]) - monkeypatch.setattr('qutebrowser.utils.version.platform.linux_distribution', - lambda: dist) ret = version._os_info() - expected = ['OS Version: {}'.format(dist_str), '', + expected = ['OS Version: ', '', '--- releaseinfo ---', 'Hello World'] assert ret == expected