Skip to content

Commit

Permalink
Merge b8c3d2f into 0085bdf
Browse files Browse the repository at this point in the history
  • Loading branch information
lavr committed Oct 8, 2018
2 parents 0085bdf + b8c3d2f commit e6fd758
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ language: python
sudo: no

python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"

script: py.test --cov emails

Expand Down
9 changes: 8 additions & 1 deletion emails/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):

elif is_py3:
import urllib.parse as urlparse
from collections import OrderedDict, Callable

try:
from collections.abc import Callable
except ImportError:
from collections import Callable

from collections import OrderedDict

from io import StringIO, BytesIO
NativeStringIO = StringIO

Expand Down
2 changes: 2 additions & 0 deletions emails/testsuite/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()

import cssutils
cssutils.log.setLevel(logging.FATAL)

@pytest.fixture(scope='module')
def django_email_backend(request):
Expand Down
2 changes: 2 additions & 0 deletions emails/testsuite/loader/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# encoding: utf-8
from __future__ import unicode_literals, print_function

import logging; import cssutils; cssutils.log.setLevel(logging.FATAL)

from emails.loader.helpers import (guess_charset, guess_text_charset, decode_text, guess_html_charset, RULES_U)


Expand Down
9 changes: 4 additions & 5 deletions emails/testsuite/loader/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
from_file='data/html_import/oldornament/oldornament/index.html',
from_zip='data/html_import/oldornament/oldornament.zip')


def test__from_html():

with pytest.raises(XMLSyntaxError):
with pytest.raises(Exception):
emails.loader.from_html(html='')

assert '-X-' in emails.loader.from_html(html='-X-').html
Expand Down Expand Up @@ -169,10 +168,10 @@ def test_external_urls():

success = 0
for url in [
'http://yandex.com',
'http://www.smashingmagazine.com/'
'https://news.ycombinator.com/',
'https://www.python.org/'
]:
print("test_external_urls: %s" % url)
print("test_external_urls: url=%s" % url)
try:
emails.loader.from_url(url)
success += 1
Expand Down
4 changes: 2 additions & 2 deletions emails/testsuite/smtp_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ def as_bool(value, default=False):
'mx.yandex.ru': dict(from_email=_from, to_email=_to,
host='mx.yandex.ru', port=25, tls=False),

'outlook.com': dict(from_email=_from, to_email='lavr@outlook.com',
host='mx1.hotmail.com'),
#'outlook.com': dict(from_email=_from, to_email='lavr@outlook.com',
# host='smtp-mail.outlook.com', port=587, tls=True),
}
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py26, py27, py33, py34, py35, py36, pypy
envlist = py27, py33, py34, py35, py36, py37, pypy

[testenv]
passenv = TEST_*
Expand Down

0 comments on commit e6fd758

Please sign in to comment.