Skip to content

Commit

Permalink
Add pragma: no cover to avoid spurious cov changes
Browse files Browse the repository at this point in the history
"pragma: no cover" was added to two helper functions in slapdtest to
avoid spurious changes in coverage whenever slapd has a hick up.

https://github.com/python-ldap/python-ldap/pull/129
Closes: https://github.com/python-ldap/python-ldap/issues/127
Signed-off-by: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
Christian Heimes authored and Petr Viktorin committed Dec 13, 2017
1 parent 9dff161 commit cf24a54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/slapdtest/_slapdtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cf24a54

Please sign in to comment.