suppress warnings outputs in unit tests

Depending on Python version, or when running test from vscode debugger,
some warning outputs can interfer with tests capturing command outputs.
pull/12435/head
Charles Brunet 1 year ago
parent 06169b32fa
commit 607fc7bb73
  1. 5
      run_unittests.py

@ -52,6 +52,11 @@ from unittests.windowstests import WindowsTests
from unittests.platformagnostictests import PlatformAgnosticTests
def unset_envs():
# Suppress warnings that can interfer with captured outputs
os.environ['PYDEVD_DISABLE_FILE_VALIDATION'] = '1'
if sys.version_info >= (3, 10):
os.environ['PYTHONWARNINGS'] = 'ignore::EncodingWarning:platform'
# For unit tests we must fully control all command lines
# so that there are no unexpected changes coming from the
# environment, for example when doing a package build.

Loading…
Cancel
Save