From 266ed9b715af4489fd960673d6329aeaa3e86e06 Mon Sep 17 00:00:00 2001 From: Terry Chia Date: Sun, 22 Mar 2015 05:56:07 +0800 Subject: [PATCH] Skip hypothesis tests on Python 2.6. --- tests/test_with_hypothesis.py | 7 +++++-- tox.ini | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_with_hypothesis.py b/tests/test_with_hypothesis.py index e2f8ebc..7c81659 100644 --- a/tests/test_with_hypothesis.py +++ b/tests/test_with_hypothesis.py @@ -1,9 +1,12 @@ -from hypothesis import given +import pytest from aead import AEAD -@given(bytes, bytes) +hypothesis = pytest.importorskip("hypothesis") + + +@hypothesis.given(bytes, bytes) def test_round_trip_encrypt_decrypt(plaintext, associated_data): cryptor = AEAD(AEAD.generate_key()) ct = cryptor.encrypt(plaintext, associated_data) diff --git a/tox.ini b/tox.ini index 4433094..442a308 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,13 @@ commands = coverage run --source=aead -m pytest --capture=no --strict {posargs} coverage report -m +[testenv:py26] +deps = + coverage + pytest +commands = + coverage run --source=aead -m pytest --capture=no --strict {posargs} + coverage report -m [testenv:pep8] deps =