diff options
author | Derek Mauro <dmauro@google.com> | 2021-12-22 21:00:44 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2021-12-22 21:01:24 (GMT) |
commit | c58f562fa2b287ab58a51b702f3c7295efe89904 (patch) | |
tree | 1179004595ed2b972b83dc62ec5adb467c5f7dd9 /googlemock | |
parent | 71d4e2f7423274d178b446e94b88082559f2fa7a (diff) | |
download | googletest-c58f562fa2b287ab58a51b702f3c7295efe89904.zip googletest-c58f562fa2b287ab58a51b702f3c7295efe89904.tar.gz googletest-c58f562fa2b287ab58a51b702f3c7295efe89904.tar.bz2 |
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
Diffstat (limited to 'googlemock')
-rwxr-xr-x | googlemock/test/gmock_leak_test.py | 2 | ||||
-rwxr-xr-x | googlemock/test/gmock_output_test.py | 2 | ||||
-rwxr-xr-x | googlemock/test/gmock_test_utils.py | 14 |
3 files changed, 3 insertions, 15 deletions
diff --git a/googlemock/test/gmock_leak_test.py b/googlemock/test/gmock_leak_test.py index 7e4b1ee..4f41c7b 100755 --- a/googlemock/test/gmock_leak_test.py +++ b/googlemock/test/gmock_leak_test.py @@ -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*'] diff --git a/googlemock/test/gmock_output_test.py b/googlemock/test/gmock_output_test.py index 25f99f2..71532c5 100755 --- a/googlemock/test/gmock_output_test.py +++ b/googlemock/test/gmock_output_test.py @@ -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 diff --git a/googlemock/test/gmock_test_utils.py b/googlemock/test/gmock_test_utils.py index 7dc4e11..d7bc097 100755 --- a/googlemock/test/gmock_test_utils.py +++ b/googlemock/test/gmock_test_utils.py @@ -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(): |