diff --git a/azure_templates/install-msmpi.yml b/azure_templates/install-msmpi.yml index ffbba5f421..1c1bafb362 100644 --- a/azure_templates/install-msmpi.yml +++ b/azure_templates/install-msmpi.yml @@ -6,4 +6,4 @@ steps: Invoke-WebRequest "https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe" -OutFile $pwd\msmpisetup.exe ; Start-Process $pwd\msmpisetup.exe -ArgumentList '-unattend' -Wait ; Remove-Item $pwd\msmpisetup.exe -Force ; - Get-CimInstance -Class Win32_Product + Get-CimInstance -Class Win32_Product | Where-Object Name -like "Microsoft MPI*" diff --git a/azure_templates/run-test.yml b/azure_templates/run-test.yml index 126ccc7721..e0baa90569 100644 --- a/azure_templates/run-test.yml +++ b/azure_templates/run-test.yml @@ -6,6 +6,5 @@ jobs: versionSpec: ${{ parameters.PYTHON_VERSION }} - template: install-msmpi.yml - template: install-python-package.yml - - task: CmdLine@2 - inputs: - script: bash -c "python -m pytest --cov-config .coveragerc --cov-report term --cov=. -v tests/test_${{ parameters.GLOB }}" + - script: bash -c "python -m pytest --cov-config .coveragerc --cov-report term --cov=. -v tests/test_${{ parameters.GLOB }}" + displayName: 'Run test' diff --git a/tests/test_monitor.py b/tests/test_monitor.py index 232fdffc26..df15f1f9ee 100644 --- a/tests/test_monitor.py +++ b/tests/test_monitor.py @@ -1,6 +1,8 @@ import uuid import json import os +import sys +import warnings import pandas import gym @@ -34,7 +36,10 @@ def test_monitor(): last_logline = pandas.read_csv(file_handler, index_col=None) assert set(last_logline.keys()) == {'l', 't', 'r'}, "Incorrect keys in monitor logline" file_handler.close() - os.remove(mon_file) + try: + os.remove(mon_file) + except PermissionError: + warnings.warn(str(sys.exc_info()[1])) def test_monitor_load_results(tmp_path): """ @@ -82,5 +87,8 @@ def test_monitor_load_results(tmp_path): assert results_size2 == (results_size1 + episode_count2) - os.remove(monitor_file1) - os.remove(monitor_file2) + try: + os.remove(monitor_file1) + os.remove(monitor_file2) + except PermissionError: + warnings.warn(str(sys.exc_info()[1]))