utils.py 515 B

1234567891011121314151617
  1. from ..utils import load_wycheproof_tests
  2. def wycheproof_tests(*paths):
  3. def wrapper(func):
  4. def run_wycheproof(backend, subtests, pytestconfig):
  5. wycheproof_root = pytestconfig.getoption(
  6. "--wycheproof-root", skip=True
  7. )
  8. for path in paths:
  9. for test in load_wycheproof_tests(wycheproof_root, path):
  10. with subtests.test():
  11. func(backend, test)
  12. return run_wycheproof
  13. return wrapper