Files
concrete/compiler/tests/python/conftest.py
youben11 1b34388d6e tests: check error message when jit-exec DF on an unsupported runtime
- factorize parallel tests
- define fixture to know if parallel tests have been selected
2022-04-14 11:07:39 +01:00

32 lines
829 B
Python

import os
import tempfile
import pytest
from concrete.compiler import KeySetCache
KEY_SET_CACHE_PATH = os.path.join(tempfile.gettempdir(), "KeySetCache")
def pytest_configure(config):
config.addinivalue_line("markers", "parallel: mark parallel tests")
@pytest.fixture(scope="session")
def keyset_cache():
return KeySetCache.new(KEY_SET_CACHE_PATH)
@pytest.fixture(scope="session")
def no_parallel(request):
"""Check if parallel tests have been selected."""
session = request.node
found_parallel = False
for item in session.items:
for marker in item.iter_markers():
if marker.name == "parallel":
found_parallel = True
break
if found_parallel:
break
print("no_parallel = ", not found_parallel)
return not found_parallel