From 4c7300ce25036949ae7641116180b64c380f3be6 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 17 Jul 2017 15:44:23 -0400 Subject: [PATCH] ceph-volume: tests: update coverage comments Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/test_configuration.py | 4 ++-- src/ceph-volume/ceph_volume/tests/test_decorators.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/tests/test_configuration.py b/src/ceph-volume/ceph_volume/tests/test_configuration.py index aad917a2d74..5ef7fae47f8 100644 --- a/src/ceph-volume/ceph_volume/tests/test_configuration.py +++ b/src/ceph-volume/ceph_volume/tests/test_configuration.py @@ -1,8 +1,8 @@ import os try: from cStringIO import StringIO -except ImportError: - from io import StringIO +except ImportError: # pragma: no cover + from io import StringIO # pragma: no cover from textwrap import dedent import pytest from ceph_volume import configuration, exceptions diff --git a/src/ceph-volume/ceph_volume/tests/test_decorators.py b/src/ceph-volume/ceph_volume/tests/test_decorators.py index 5bb9d468aa0..8df891456e6 100644 --- a/src/ceph-volume/ceph_volume/tests/test_decorators.py +++ b/src/ceph-volume/ceph_volume/tests/test_decorators.py @@ -9,11 +9,11 @@ class TestNeedsRoot(object): def func(): return True monkeypatch.setattr(decorators.os, 'getuid', lambda: 0) - assert decorators.needs_root(func)()() is True + assert decorators.needs_root(func)() is True def test_is_not_root(self, monkeypatch): def func(): - return True + return True # pragma: no cover monkeypatch.setattr(decorators.os, 'getuid', lambda: 20) with pytest.raises(exceptions.SuperUserError) as error: decorators.needs_root(func)()