Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Add python 3.6 to the test suite #348

Merged
merged 3 commits into from
Sep 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "pypy-5.3.1"

env:
Expand All @@ -19,7 +20,7 @@ matrix:

install:
- ".travis/install.sh"
before_script: "flake8 --max-complexity 15 hyper test"
before_script: "flake8 hyper test"

script:
- ".travis/run.sh"
2 changes: 1 addition & 1 deletion .travis/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x
if [[ "$TEST_RELEASE" == true ]]; then
py.test test_release.py
else
if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then
if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then
py.test test/
else
coverage run -m py.test test/
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[wheel]
universal = 1

[flake8]
max-complexity = 15
1 change: 0 additions & 1 deletion test/test_SSLContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def test_custom_context(self):

assert not hyper.tls._context.check_hostname
assert hyper.tls._context.verify_mode == ssl.CERT_NONE
assert hyper.tls._context.options & ssl.OP_NO_COMPRESSION == 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.6 fails on this line with an error:

______________________________________________________________________________ TestSSLContext.test_custom_context _________

self = <test_SSLContext.TestSSLContext object at 0x10d106b70>

    def test_custom_context(self):
        # The following SSLContext doesn't provide any valid certicate.
        # Its purpose is only to confirm that hyper is not using its
        # default SSLContext.
        context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
        context.verify_mode = ssl.CERT_NONE
        context.check_hostname = False
    
        hyper.tls._context = context
    
        assert not hyper.tls._context.check_hostname
        assert hyper.tls._context.verify_mode == ssl.CERT_NONE
>       assert hyper.tls._context.options & ssl.OP_NO_COMPRESSION == 0
E       AssertionError: assert (<Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_CIPHER_SERVER_PREFERENCE|OP_SINGLE_DH_USE|OP_SINGLE_ECDH_USE|OP_NO_COMPRESSION: 2203714559> & <Options.OP_NO_COMPRESSION: 131072>) == 0
E        +  where <Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_CIPHER_SERVER_PREFERENCE|OP_SINGLE_DH_USE|OP_SINGLE_ECDH_USE|OP_NO_COMPRESSION: 2203714559> = <ssl.SSLContext object at 0x10d102898>.options
E        +    where <ssl.SSLContext object at 0x10d102898> = <module 'hyper.tls' from '/Users/kostya/Code/_contrib/hyper/hyper/tls.py'>._context
E        +      where <module 'hyper.tls' from '/Users/kostya/Code/_contrib/hyper/hyper/tls.py'> = hyper.tls
E        +  and   <Options.OP_NO_COMPRESSION: 131072> = ssl.OP_NO_COMPRESSION

test/test_SSLContext.py:43: AssertionError

From what I understand this check is not essential in the test. Please let me know if I'm wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole test seems kinda stupid, to be honest, but yeah, this line is non-essential.


def test_HTTPConnection_with_custom_context(self):
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest>=2.7
pytest>=3.0
pytest-xdist
pytest-cov
requests
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, py35, pypy, lint
envlist = py{27,34,35,36}, pypy, lint

[testenv]
deps= -r{toxinidir}/test_requirements.txt
Expand All @@ -12,6 +12,6 @@ commands=
commands= py.test {toxinidir}/test/

[testenv:lint]
basepython=python3.5
basepython=python3
deps = flake8==2.5.4
commands = flake8 --max-complexity 15 hyper test
commands = flake8 hyper test