diff --git a/netlib/debug.py b/netlib/debug.py index ca25b8287..bf446eb03 100644 --- a/netlib/debug.py +++ b/netlib/debug.py @@ -12,15 +12,18 @@ def sysinfo(): "Platform: %s"%platform.platform(), ] d = platform.linux_distribution() - if d[0]: - data.append("Linux distro: %s %s %s"%d) + t = "Linux distro: %s %s %s"%d + if d[0]: # pragma: no-cover + data.append(t) d = platform.mac_ver() - if d[0]: - data.append("Mac version: %s %s %s"%d) + t = "Mac version: %s %s %s"%d + if d[0]: # pragma: no-cover + data.append(t) d = platform.win32_ver() - if d[0]: - data.append("Windows version: %s %s %s %s"%d) + t = "Windows version: %s %s %s %s"%d + if d[0]: # pragma: no-cover + data.append(t) return "\n".join(data) diff --git a/test/netlib/test_debug.py b/test/netlib/test_debug.py new file mode 100644 index 000000000..d174bb5fd --- /dev/null +++ b/test/netlib/test_debug.py @@ -0,0 +1,6 @@ + +from netlib import debug + + +def test_sysinfo(): + assert debug.sysinfo()