aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_utils.py
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-10-16 15:07:30 -0700
committerDonald Stufft <donald@stufft.io>2013-10-16 15:07:30 -0700
commit9a76847c67f76184afbd5274d55ac55c34e06dd2 (patch)
tree0169b36528a7ef6fddcd3f5c097e0083f84f80ec /tests/primitives/test_utils.py
parentb98118f59f1f6ba79f3b5cdd705ebc56f9ec9f34 (diff)
parent745c95c75cc6588ecd9b927e5974bf00426125a2 (diff)
downloadcryptography-9a76847c67f76184afbd5274d55ac55c34e06dd2.tar.gz
cryptography-9a76847c67f76184afbd5274d55ac55c34e06dd2.tar.bz2
cryptography-9a76847c67f76184afbd5274d55ac55c34e06dd2.zip
Merge pull request #106 from alex/duplication-reduction
Remove much of the duplication found in the tests
Diffstat (limited to 'tests/primitives/test_utils.py')
-rw-r--r--tests/primitives/test_utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/primitives/test_utils.py b/tests/primitives/test_utils.py
new file mode 100644
index 00000000..4666ece7
--- /dev/null
+++ b/tests/primitives/test_utils.py
@@ -0,0 +1,14 @@
+import pytest
+
+from .utils import encrypt_test
+
+
+class TestEncryptTest(object):
+ def test_skips_if_only_if_returns_false(self):
+ with pytest.raises(pytest.skip.Exception) as exc_info:
+ encrypt_test(
+ None, None, None, None,
+ only_if=lambda api: False,
+ skip_message="message!"
+ )
+ assert exc_info.value.args[0] == "message!"