File tree Expand file tree Collapse file tree 5 files changed +30
-5
lines changed
Expand file tree Collapse file tree 5 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 3535 - name : Run test
3636 run : |
3737 source venv/bin/activate
38- pytest tests/python/funtional
38+ pytest --data=./data tests/python/funtional
3939 CPP-Code-Quality :
4040 name : CPP-Code-Quality
4141 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (C) 2024 Intel Corporation
3+ # SPDX-License-Identifier: Apache-2.0
4+ #
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (C) 2024 Intel Corporation
3+ # SPDX-License-Identifier: Apache-2.0
4+ #
5+
6+ import pytest
7+
8+
9+ def pytest_addoption (parser ):
10+ parser .addoption ("--data" , action = "store" , help = "data folder with dataset" )
11+
12+
13+ @pytest .fixture (scope = "session" )
14+ def data (pytestconfig ):
15+ return pytestconfig .getoption ("data" )
Original file line number Diff line number Diff line change 22# Copyright (C) 2020-2024 Intel Corporation
33# SPDX-License-Identifier: Apache-2.0
44#
5+
6+ from pathlib import Path
7+
58from model_api .models import Model
69
710
8- def test_model_with_unnamed_output_load ():
11+ def test_model_with_unnamed_output_load (data ):
912 # the model's output doesn't have a name
1013 _ = Model .create_model (
11- " data/ otx_models/tinynet_imagenet.xml" ,
14+ Path ( data ) / " otx_models/tinynet_imagenet.xml" ,
1215 model_type = "Classification" ,
1316 preload = True ,
1417 )
Original file line number Diff line number Diff line change 22# Copyright (C) 2020-2024 Intel Corporation
33# SPDX-License-Identifier: Apache-2.0
44#
5+
6+ from pathlib import Path
7+
58from model_api .models import Model
69from model_api .adapters import ONNXRuntimeAdapter
710from model_api .adapters .utils import load_parameters_from_onnx
@@ -60,9 +63,9 @@ def test_segmentor_save(tmp_path):
6063 assert getattr (downloaded , attr ) == getattr (deserialized , attr )
6164
6265
63- def test_onnx_save (tmp_path ):
66+ def test_onnx_save (tmp_path , data ):
6467 cls_model = Model .create_model (
65- ONNXRuntimeAdapter (" data/ otx_models/cls_mobilenetv3_large_cars.onnx" ),
68+ ONNXRuntimeAdapter (Path ( data ) / " otx_models/cls_mobilenetv3_large_cars.onnx" ),
6669 model_type = "Classification" ,
6770 preload = True ,
6871 configuration = {"reverse_input_channels" : True , "topk" : 6 },
You can’t perform that action at this time.
0 commit comments