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

Fixup failing import tests #297

Merged
merged 3 commits into from
Dec 2, 2016
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
1 change: 1 addition & 0 deletions hyper/ssl_compat.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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