From f42f56870c6201a876f025a423eb5540d7438e83 Mon Sep 17 00:00:00 2001 From: alexander Date: Fri, 16 Jul 2021 11:30:56 +0100 Subject: MLECO-2079 Adding the python KWS example Signed-off-by: Eanna O Cathain Change-Id: Ie1463aaeb5e3cade22df8f560ae99a8e1c4a9c17 --- .../examples/speech_recognition/tests/conftest.py | 58 +++++++++------------- 1 file changed, 24 insertions(+), 34 deletions(-) (limited to 'python/pyarmnn/examples/speech_recognition/tests/conftest.py') diff --git a/python/pyarmnn/examples/speech_recognition/tests/conftest.py b/python/pyarmnn/examples/speech_recognition/tests/conftest.py index 730c291cfa..151816e919 100644 --- a/python/pyarmnn/examples/speech_recognition/tests/conftest.py +++ b/python/pyarmnn/examples/speech_recognition/tests/conftest.py @@ -1,34 +1,24 @@ -# Copyright © 2020 Arm Ltd and Contributors. All rights reserved. -# SPDX-License-Identifier: MIT - -import os -import ntpath - -import urllib.request - -import pytest - -script_dir = os.path.dirname(__file__) - -@pytest.fixture(scope="session") -def test_data_folder(request): - """ - This fixture returns path to folder with shared test resources among all tests - """ - - data_dir = os.path.join(script_dir, "testdata") - - if not os.path.exists(data_dir): - os.mkdir(data_dir) - - files_to_download = ["https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master" - "/sampledata/audiofiles/myVoiceIsMyPassportVerifyMe04.wav"] - - for file in files_to_download: - path, filename = ntpath.split(file) - file_path = os.path.join(script_dir, "testdata", filename) - if not os.path.exists(file_path): - print("\nDownloading test file: " + file_path + "\n") - urllib.request.urlretrieve(file, file_path) - - return data_dir +# Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +# SPDX-License-Identifier: MIT + +import os +import ntpath + +import urllib.request + +import pytest + +script_dir = os.path.dirname(__file__) + +@pytest.fixture(scope="session") +def test_data_folder(request): + """ + This fixture returns path to folder with shared test resources among asr tests + """ + + data_dir = os.path.join(script_dir, "testdata") + + if not os.path.exists(data_dir): + os.mkdir(data_dir) + + return data_dir \ No newline at end of file -- cgit v1.2.1