From 8e144aa33faa547474d8bb90d2f62f8d298be3d7 Mon Sep 17 00:00:00 2001 From: Brian Sheedy Date: Tue, 23 Jun 2020 16:02:16 -0700 Subject: [PATCH] Remove WebRTC usage of //third_party/pymock Removes usage of Chromium's //third_party/pymock in favor of the version provided by vpython. This is so that the third_party version can eventually be removed. TBR=aleloi@webrtc.org Bug: chromium:1094489 Change-Id: I68511e11ed1e517c2b6d3bb832090a3c27e480e5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177921 Commit-Queue: Mirko Bonadei Reviewed-by: Mirko Bonadei Reviewed-by: Alex Loiko Cr-Commit-Position: refs/heads/master@{#31568} --- .../apm_quality_assessment_unittest.py | 5 ----- .../quality_assessment/input_mixer_unittest.py | 5 ----- .../quality_assessment/simulation_unittest.py | 5 ----- tools_webrtc/autoroller/unittests/roll_deps_test.py | 4 +--- tools_webrtc/libs/generate_licenses_test.py | 9 +-------- 5 files changed, 2 insertions(+), 26 deletions(-) diff --git a/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py b/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py index f5240f8696..c0f3d0e2a7 100644 --- a/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py +++ b/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment_unittest.py @@ -9,14 +9,9 @@ """Unit tests for the apm_quality_assessment module. """ -import os import sys import unittest -SRC = os.path.abspath(os.path.join( - os.path.dirname((__file__)), os.pardir, os.pardir, os.pardir)) -sys.path.append(os.path.join(SRC, 'third_party', 'pymock')) - import mock import apm_quality_assessment diff --git a/modules/audio_processing/test/py_quality_assessment/quality_assessment/input_mixer_unittest.py b/modules/audio_processing/test/py_quality_assessment/quality_assessment/input_mixer_unittest.py index b212614199..87257e2fc9 100644 --- a/modules/audio_processing/test/py_quality_assessment/quality_assessment/input_mixer_unittest.py +++ b/modules/audio_processing/test/py_quality_assessment/quality_assessment/input_mixer_unittest.py @@ -12,14 +12,9 @@ import logging import os import shutil -import sys import tempfile import unittest -SRC = os.path.abspath(os.path.join( - os.path.dirname((__file__)), os.pardir, os.pardir, os.pardir, os.pardir)) -sys.path.append(os.path.join(SRC, 'third_party', 'pymock')) - import mock from . import exceptions diff --git a/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation_unittest.py b/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation_unittest.py index c39b12dd00..7d9ad6ca79 100644 --- a/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation_unittest.py +++ b/modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation_unittest.py @@ -12,14 +12,9 @@ import logging import os import shutil -import sys import tempfile import unittest -SRC = os.path.abspath(os.path.join( - os.path.dirname((__file__)), os.pardir, os.pardir, os.pardir, os.pardir)) -sys.path.append(os.path.join(SRC, 'third_party', 'pymock')) - import mock import pydub diff --git a/tools_webrtc/autoroller/unittests/roll_deps_test.py b/tools_webrtc/autoroller/unittests/roll_deps_test.py index 8d68bddc35..8f6d57efea 100755 --- a/tools_webrtc/autoroller/unittests/roll_deps_test.py +++ b/tools_webrtc/autoroller/unittests/roll_deps_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license @@ -24,8 +24,6 @@ from roll_deps import CalculateChangedDeps, FindAddedDeps, \ GetMatchingDepsEntries, ParseDepsDict, ParseLocalDepsFile, UpdateDepsFile, \ ChromiumRevisionUpdate -SRC_DIR = os.path.join(PARENT_DIR, os.pardir, os.pardir) -sys.path.append(os.path.join(SRC_DIR, 'third_party', 'pymock')) import mock TEST_DATA_VARS = { diff --git a/tools_webrtc/libs/generate_licenses_test.py b/tools_webrtc/libs/generate_licenses_test.py index 03f14459c2..fa05eaa12f 100755 --- a/tools_webrtc/libs/generate_licenses_test.py +++ b/tools_webrtc/libs/generate_licenses_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # pylint: disable=relative-import,protected-access,unused-argument # Copyright 2017 The WebRTC project authors. All Rights Reserved. @@ -9,13 +9,6 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. -import os -import sys - -SRC = os.path.abspath( - os.path.join(os.path.dirname((__file__)), os.pardir, os.pardir)) -sys.path.append(os.path.join(SRC, 'third_party', 'pymock')) - import unittest import mock