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

Commit db5f541

Browse files
committed
Confirm import fails on unsupported versions.
1 parent b04a212 commit db5f541

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_import.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import hyper
2+
import imp
3+
import pytest
4+
import sys
5+
6+
7+
class TestImportPython2(object):
8+
def test_cannot_import_python_2(self, monkeypatch):
9+
monkeypatch.setattr(sys, 'version_info', (2, 7, 7, 'final', 0))
10+
with pytest.raises(ImportError):
11+
imp.reload(hyper)
12+
13+
14+
class TestImportPython3(object):
15+
def test_cannot_import_python_32(self, monkeypatch):
16+
monkeypatch.setattr(sys, 'version_info', (3, 2, 3, 'final', 0))
17+
with pytest.raises(ImportError):
18+
imp.reload(hyper)

0 commit comments

Comments
 (0)