diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 1dae245f..df4ba27f 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -45,6 +45,12 @@ jobs: poetry config virtualenvs.create false poetry install --no-interaction --no-ansi --without docs --with dev - - name: Run pytest + - name: Run pytest with admin (Windows) + if: runner.os == 'Windows' + run: | + PowerShell -Command "Start-Process poetry -ArgumentList 'run pytest' -Verb RunAs" + + - name: Run pytest (Non-Windows) + if: runner.os != 'Windows' run: | poetry run pytest diff --git a/tests/test_text_onnx_embeddings.py b/tests/test_text_onnx_embeddings.py index b65bcd49..986fbb58 100644 --- a/tests/test_text_onnx_embeddings.py +++ b/tests/test_text_onnx_embeddings.py @@ -87,10 +87,7 @@ def test_embedding(): ), model_desc["model"] if CI: - if os.path.isfile(MODELS_CACHE_DIR): - os.remove(MODELS_CACHE_DIR) - else: - shutil.rmtree(MODELS_CACHE_DIR) + shutil.rmtree(MODELS_CACHE_DIR) @pytest.mark.parametrize(