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

Commit 3041301

Browse files
committed
Skip import tests on wrong platforms.
1 parent fdf698e commit 3041301

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/test_import.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66

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

1314

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

0 commit comments

Comments
 (0)