Skip to content

Commit

Permalink
Merge pull request #22 from zopefoundation/fix-coverage
Browse files Browse the repository at this point in the history
Fix tox -e coverage
  • Loading branch information
mgedmin committed Feb 7, 2019
2 parents aa2df0a + 0619e9d commit 3f64175
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[run]
source = zope.sendmail
plugins = coverage_python_version

[report]
precision = 2
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ matrix:
sudo: true
install:
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U coverage coveralls coverage-python-version
- pip install -U -e .[test]
script:
- coverage run -m zope.testrunner --test-path=src
Expand Down
4 changes: 2 additions & 2 deletions src/zope/sendmail/_compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
try:
text_type = unicode
PY2 = True
except NameError: # pragma: NO COVER Py3k
PY2 = True # pragma: PY2
except NameError: # pragma: PY3
text_type = str
PY2 = False
4 changes: 2 additions & 2 deletions src/zope/sendmail/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def send(self, fromaddr, toaddrs, message):
if self.username is not None and self.password is not None:
username, password = self.username, self.password
if PY2 and isinstance(username, text_type):
username = username.encode('utf-8')
username = username.encode('utf-8') # pragma: PY2
if PY2 and isinstance(password, text_type):
password = password.encode('utf-8')
password = password.encode('utf-8') # pragma: PY2
connection.login(username, password)
elif self.username:
raise RuntimeError('Mailhost does not support ESMTP but a username '
Expand Down
2 changes: 1 addition & 1 deletion src/zope/sendmail/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

try:
import ConfigParser as configparser
except ImportError:
except ImportError: # pragma: PY3
import configparser

# The longest time sending a file is expected to take. Longer than this and
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ commands =
deps =
{[testenv]deps}
coverage
coverage-python-version

[testenv:docs]
commands =
Expand Down

0 comments on commit 3f64175

Please sign in to comment.