aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2018-07-16 11:18:33 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2018-07-16 20:48:33 +0530
commit2e85a925b49e566776585f35a7c0653510d84262 (patch)
treee6c6242efcab8249cbc56e6db8735e3566b0b96a /tests/conftest.py
parentb09b9ecd695187f323c509aecdf517cadcf728d1 (diff)
downloadcryptography-2e85a925b49e566776585f35a7c0653510d84262.tar.gz
cryptography-2e85a925b49e566776585f35a7c0653510d84262.tar.bz2
cryptography-2e85a925b49e566776585f35a7c0653510d84262.zip
Refs #3331 -- added initial wycheproof integration, starting with x25519, rsa, and keywrap (#4310)
* Refs #3331 -- added initial wycheproof integration, starting with x25519 tests
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index c5efbd36..583c4099 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -8,13 +8,30 @@ import pytest
from cryptography.hazmat.backends.openssl import backend as openssl_backend
-from .utils import check_backend_support
+from .utils import (
+ check_backend_support, load_wycheproof_tests, skip_if_wycheproof_none
+)
def pytest_report_header(config):
return "OpenSSL: {0}".format(openssl_backend.openssl_version_text())
+def pytest_addoption(parser):
+ parser.addoption("--wycheproof-root", default=None)
+
+
+def pytest_generate_tests(metafunc):
+ if "wycheproof" in metafunc.fixturenames:
+ wycheproof = metafunc.config.getoption("--wycheproof-root")
+ skip_if_wycheproof_none(wycheproof)
+
+ testcases = []
+ for path in metafunc.function.wycheproof_tests.args:
+ testcases.extend(load_wycheproof_tests(wycheproof, path))
+ metafunc.parametrize("wycheproof", testcases)
+
+
@pytest.fixture()
def backend(request):
required_interfaces = [