Files
openvino/tests/layer_tests/tensorflow_tests/conftest.py
Vitaliy Urusovskij 29b15233c7 Remove OV_FRONTEND_PATH (#15364)
* Remove "OV_FRONTEND_PATH" from `FrontEndManager`

* Remove "OV_FRONTEND_PATH" from layer_tests

* Remove "OV_FRONTEND_PATH" from find_ie_version.py

* Remove "OV_FRONTEND_PATH" from .ci/

* Move `ov::get_plugin_path` to file_util.hpp (ov::util)

* Add `register_front_end(name, path)` FEM public API

* Enable frontend/ tests

* ClangFormat

* Remove OV_FRONTEND_PATH from FE shared utils

* Add `register_front_end()` to PythonAPI

* Update Py tests with registering of "mock_py" FE

* ClangFormat

* Leftovers

* Fix SegFault with `register_front_end(name, lib_path)`

* Add FE_LIB_PRE and FE_LIB_SUFFIX to `ov_core_unit_tests`

* Fix format

* Update `testFailRegisterFEByWrongPath`
2023-02-02 08:19:35 +04:00

35 lines
1.2 KiB
Python

# 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])