From 7c4cee9820f0f5300d6563bf688273a8e598e2e2 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 13 Dec 2017 15:42:10 +0100 Subject: [PATCH] Add pragma: no cover to avoid spurious cov changes "pragma: no cover" was added to two helper functions in slapdtest to avoid spurious changes in coverage whenever slapd has a hick up. Closes: https://github.com/python-ldap/python-ldap/issues/127 Signed-off-by: Christian Heimes --- Lib/slapdtest/_slapdtest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/slapdtest/_slapdtest.py b/Lib/slapdtest/_slapdtest.py index f3f096c3..ef627ef6 100644 --- a/Lib/slapdtest/_slapdtest.py +++ b/Lib/slapdtest/_slapdtest.py @@ -344,7 +344,9 @@ def _start_slapd(self): self._log.info('starting slapd: %r', ' '.join(slapd_args)) self._proc = subprocess.Popen(slapd_args) # Waits until the LDAP server socket is open, or slapd crashed - while 1: + # no cover to avoid spurious coverage changes, see + # https://github.com/python-ldap/python-ldap/issues/127 + while 1: # pragma: no cover if self._proc.poll() is not None: self._stopped() raise RuntimeError("slapd exited before opening port") @@ -430,7 +432,9 @@ def _cli_auth_args(self): ] return authc_args - def _cli_popen(self, ldapcommand, extra_args=None, ldap_uri=None, stdin_data=None): + # no cover to avoid spurious coverage changes + def _cli_popen(self, ldapcommand, extra_args=None, ldap_uri=None, + stdin_data=None): # pragma: no-cover args = [ ldapcommand, '-H', ldap_uri or self.ldapi_uri,