forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
34 lines (26 loc) · 1.2 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
import logging as log
import os
from pathlib import Path
import pytest
from common.layer_test_class import get_params
from common.utils.common_utils import copy_files_by_pattern
def pytest_generate_tests(metafunc):
test_gen_attrs_names = list(inspect.signature(get_params).parameters)
params = get_params()
setattr(metafunc.cls, 'tflite', metafunc.config.getoption('tflite'))
metafunc.parametrize(test_gen_attrs_names, params, scope="function")
@pytest.fixture(scope='session', autouse=True)
def rename_tf_fe_libs(request):
try:
import openvino.runtime as rt
# path below is built considering the use of wheels
openvino_lib_path = Path(rt.__file__).parent.parent / 'libs'
except ImportError as err:
raise Exception("Please set PYTHONPATH to OpenVINO Python or install wheel package") from err
tf_fe_lib_names = ['libopenvino_tensorflow_fe', 'libopenvino_tensorflow_frontend']
if request.config.getoption('use_new_frontend'):
log.info('Using new frontend...')
copy_files_by_pattern(openvino_lib_path, tf_fe_lib_names[0], tf_fe_lib_names[1])