diff --git a/fail2ban/tests/filtertestcase.py b/fail2ban/tests/filtertestcase.py index 59c7820a..b5877b7f 100644 --- a/fail2ban/tests/filtertestcase.py +++ b/fail2ban/tests/filtertestcase.py @@ -673,10 +673,10 @@ class LogFileMonitor(LogCaptureTestCase): failure_was_logged = self._is_logged('Unable to open %s' % self.name) # verify that we cannot access the file. Checking by name of user is not # sufficient since could be a fakeroot or some other super-user + is_root = True try: - with open(self.name) as f: + with open(self.name) as f: # pragma: no cover - normally no root f.read() - is_root = True except IOError: is_root = False diff --git a/fail2ban/tests/utils.py b/fail2ban/tests/utils.py index 2ed9b463..852af3ec 100644 --- a/fail2ban/tests/utils.py +++ b/fail2ban/tests/utils.py @@ -56,7 +56,7 @@ if not CONFIG_DIR: # Use heuristic to figure out where configuration files are if os.path.exists(os.path.join('config','fail2ban.conf')): CONFIG_DIR = 'config' - else: + else: # pragma: no cover - normally unreachable CONFIG_DIR = '/etc/fail2ban' # Indicates that we've stock config: