Makes the Python imports consistently use full paths from the repository root,

unifying the behavior between Bazel and CMake

This fixes one of the CI failures on Windows

PiperOrigin-RevId: 417872531
Change-Id: I156989323b7e6d4a4420f4f9691b078829db933d
This commit is contained in:
Derek Mauro
2021-12-22 13:00:44 -08:00
committed by Copybara-Service
parent 71d4e2f742
commit c58f562fa2
29 changed files with 34 additions and 44 deletions

View File

@@ -31,7 +31,7 @@
"""Tests that leaked mock objects can be caught be Google Mock."""
import gmock_test_utils
from googlemock.test import gmock_test_utils
PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']

View File

@@ -43,7 +43,7 @@ from io import open # pylint: disable=redefined-builtin, g-importing-member
import os
import re
import sys
import gmock_test_utils
from googlemock.test import gmock_test_utils
# The flag for generating the golden file

View File

@@ -30,21 +30,9 @@
"""Unit test utilities for Google C++ Mocking Framework."""
import os
import sys
# Determines path to gtest_test_utils and imports it.
SCRIPT_DIR = os.path.dirname(__file__) or '.'
# isdir resolves symbolic links.
gtest_tests_util_dir = os.path.join(SCRIPT_DIR, '../../googletest/test')
if os.path.isdir(gtest_tests_util_dir):
GTEST_TESTS_UTIL_DIR = gtest_tests_util_dir
else:
GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR, '../../googletest/test')
sys.path.append(GTEST_TESTS_UTIL_DIR)
# pylint: disable=C6204
import gtest_test_utils
from googletest.test import gtest_test_utils
def GetSourceDir():