blob: e059b6308d5d58178a357f66ecea13f5bf650399 [file] [log] [blame]
Paul Kehrer7e4bc6d2013-12-24 22:23:53 -06001import pytest
2
3from cryptography.hazmat.backends.interfaces import (
4 HMACBackend, CipherBackend, HashBackend
5)
6
Alex Gaynor2b3f9422013-12-24 21:55:24 -08007from .utils import check_for_iface
Paul Kehrer7e4bc6d2013-12-24 22:23:53 -06008
9
Alex Gaynor814efab2013-10-03 09:24:58 -070010def pytest_generate_tests(metafunc):
Alex Gaynorf8796b12013-12-13 20:28:55 -080011 from cryptography.hazmat.backends import _ALL_BACKENDS
Alex Gaynor814efab2013-10-03 09:24:58 -070012
Paul Kehrerdb37d0e2013-10-22 20:13:06 -050013 if "backend" in metafunc.fixturenames:
14 metafunc.parametrize("backend", _ALL_BACKENDS)
Paul Kehrer7e4bc6d2013-12-24 22:23:53 -060015
16
17@pytest.mark.trylast
18def pytest_runtest_setup(item):
Alex Gaynor2b3f9422013-12-24 21:55:24 -080019 check_for_iface("hmac", HMACBackend, item)
20 check_for_iface("cipher", CipherBackend, item)
21 check_for_iface("hash", HashBackend, item)