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

Conversation

KostyaEsmukov
Copy link
Contributor

No description provided.

@@ -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.

@@ -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
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.

Copy link
Member

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Cool, looks great! ✨

@Lukasa Lukasa merged commit 13e2a90 into python-hyper:development Sep 2, 2017
@KostyaEsmukov KostyaEsmukov deleted the pr/py36_tests branch September 2, 2017 17:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants