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

Commit

Permalink
Merge pull request #297 from Lukasa/fixup-tests
Browse files Browse the repository at this point in the history
Fixup failing import tests
  • Loading branch information
Lukasa committed Dec 2, 2016
2 parents 12e67a4 + 3475cc2 commit 1f8e53f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions hyper/ssl_compat.py
Expand Up @@ -48,6 +48,7 @@ def inner(self, *args, **kwargs):
return getattr(self._conn, method)(*args, **kwargs)
return inner


# Referenced in hyper/http20/connection.py. These values come
# from the python ssl package, and must be defined in this file
# for hyper to work in python versions <2.7.9
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -78,7 +78,7 @@ def run_tests(self):
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
],
install_requires=['h2>=2.4,<3.0', 'hyperframe>=3.2,<4.0'],
install_requires=['h2>=2.4,<3.0,!=2.5.0', 'hyperframe>=3.2,<4.0'],
tests_require=['pytest', 'requests', 'mock'],
cmdclass={'test': PyTest},
entry_points={
Expand Down
2 changes: 2 additions & 0 deletions test/test_import.py
Expand Up @@ -5,13 +5,15 @@


class TestImportPython2(object):
@pytest.mark.skipif(sys.version_info[0] == 3, reason="Python 2 only")
def test_cannot_import_python_2(self, monkeypatch):
monkeypatch.setattr(sys, 'version_info', (2, 6, 5, 'final', 0))
with pytest.raises(ImportError):
imp.reload(hyper)


class TestImportPython3(object):
@pytest.mark.skipif(sys.version_info[0] == 2, reason="Python 3 only")
def test_cannot_import_python_32(self, monkeypatch):
monkeypatch.setattr(sys, 'version_info', (3, 2, 3, 'final', 0))
with pytest.raises(ImportError):
Expand Down

0 comments on commit 1f8e53f

Please sign in to comment.