summaryrefslogtreecommitdiff
path: root/tests/wycheproof/utils.py
blob: 3c18e62afa435e0eb59d5c154f5ae8a3cad6cc3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ..utils import load_wycheproof_tests


def wycheproof_tests(*paths):
    def wrapper(func):
        def run_wycheproof(
            backend, disable_rsa_checks, subtests, pytestconfig
        ):
            wycheproof_root = pytestconfig.getoption(
                "--wycheproof-root", skip=True
            )
            for path in paths:
                for test in load_wycheproof_tests(wycheproof_root, path):
                    with subtests.test():
                        func(backend, test)

        return run_wycheproof

    return wrapper