From 7908081fd6fd9462ec5dbedd71e3986da880359c Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 5 Oct 2015 18:00:06 -0700 Subject: [PATCH 1/4] Adding testing support for Python 3.3, 3.4 and 3.5 --- .travis.yml | 3 +++ README.rst | 5 ++++- tox.ini | 19 +++++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d3cf78c5..54e379fae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,9 @@ python: - '2.6' - '2.7' - '3.2' +- '3.3' +- '3.4' +- '3.5' install: - python setup.py install script: diff --git a/README.rst b/README.rst index 5587eca3a..0563ab6d2 100644 --- a/README.rst +++ b/README.rst @@ -483,6 +483,9 @@ Tests pyenv install 2.6.9 pyenv install 2.7.8 pyenv install 3.2.6 + pyenv install 3.3.6 + pyenv install 3.4.3 + pyenv install 3.5.0 **Run the tests:** @@ -491,7 +494,7 @@ Tests virtualenv venv source venv/bin/activate #or . ./activate.sh python setup.py install - pyenv local 3.2.6 2.7.8 2.6.9 + pyenv local 3.5.0 3.4.3 3.3.6 3.2.6 2.7.8 2.6.9 pyenv rehash tox diff --git a/tox.ini b/tox.ini index a8b9b53ad..ebd181b59 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py26, py27, py32 +envlist = py26, py27, py32, py33, py34, py35 [testenv] commands = {envbindir}/python -m unittest discover -v [] @@ -23,4 +23,19 @@ basepython = python2.7 [testenv:py32] commands = {envbindir}/python -m unittest discover -v [] deps = -basepython = python3.2 \ No newline at end of file +basepython = python3.2 + +[testenv:py33] +commands = {envbindir}/python -m unittest discover -v [] +deps = +basepython = python3.3 + +[testenv:py34] +commands = {envbindir}/python -m unittest discover -v [] +deps = +basepython = python3.4 + +[testenv:py35] +commands = {envbindir}/python -m unittest discover -v [] +deps = +basepython = python3.5 \ No newline at end of file From 5d64c204b6639014a3fd256dd71cd9c01ecc1227 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 5 Oct 2015 18:03:16 -0700 Subject: [PATCH 2/4] Updating license --- MIT.LICENSE | 15 +++++++++++++++ README.rst | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 MIT.LICENSE diff --git a/MIT.LICENSE b/MIT.LICENSE new file mode 100644 index 000000000..ef8b18d38 --- /dev/null +++ b/MIT.LICENSE @@ -0,0 +1,15 @@ +Copyright (c) 2015 SendGrid + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of +the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.rst b/README.rst index 0563ab6d2..000712c79 100644 --- a/README.rst +++ b/README.rst @@ -510,9 +510,6 @@ Deploying - Push changes to GitHub - Release tag on GitHub `vX.X.X` -MIT License ------------ - .. _X-SMTPAPI: http://sendgrid.com/docs/API_Reference/SMTP_API/ .. _SMTPAPI Python library: https://github.com/sendgrid/smtpapi-python .. _Substitution: http://sendgrid.com/docs/API_Reference/SMTP_API/substitution_tags.html From e9979cf480509a9a61857f33e78f4f4638be7a50 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 5 Oct 2015 18:09:25 -0700 Subject: [PATCH 3/4] Making debugging the tests easier --- test/test_mail_v2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_mail_v2.py b/test/test_mail_v2.py index 7038d3663..689ed2b91 100644 --- a/test/test_mail_v2.py +++ b/test/test_mail_v2.py @@ -22,6 +22,7 @@ class TestSendGrid(unittest.TestCase): def setUp(self): self.sg = SendGridClient(SG_USER, SG_PWD) + self.maxDiff = None def test_apikey_init(self): sg = SendGridClient(SG_PWD) From 8b27acce37b53438c14206a56f95ec56c2956ae6 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Mon, 5 Oct 2015 18:14:07 -0700 Subject: [PATCH 4/4] We don't care about the order of the result, only that they match. --- test/test_mail_v2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_mail_v2.py b/test/test_mail_v2.py index 689ed2b91..ad6ff5e61 100644 --- a/test/test_mail_v2.py +++ b/test/test_mail_v2.py @@ -98,7 +98,10 @@ def test_send(self): } ''')) - self.assertEqual(url, test_url) + try: + self.assertItemsEqual(url, test_url) + except: # Python 3+ + self.assertCountEqual(url, test_url) @unittest.skipUnless(sys.version_info < (3, 0), 'only for python2') def test__build_body_unicode(self):