From 0ad1bfc2fa0a2226740fa631e7b76193da4b33a9 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 27 Feb 2024 09:06:52 -0800 Subject: [PATCH] Automated Code Change PiperOrigin-RevId: 610771450 --- .../protobuf/compiler/python/plugin_unittest.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/google/protobuf/compiler/python/plugin_unittest.cc b/src/google/protobuf/compiler/python/plugin_unittest.cc index fddfb1766e..6d9148432e 100644 --- a/src/google/protobuf/compiler/python/plugin_unittest.cc +++ b/src/google/protobuf/compiler/python/plugin_unittest.cc @@ -15,7 +15,6 @@ #include "google/protobuf/testing/file.h" #include "google/protobuf/compiler/command_line_interface.h" #include "google/protobuf/compiler/python/generator.h" -#include "google/protobuf/testing/googletest.h" #include #include "absl/log/absl_check.h" #include "absl/strings/str_split.h" @@ -58,7 +57,7 @@ TEST(PythonPluginTest, ImportTest) { // Create files test1.proto and test2.proto with the former importing the // latter. ABSL_CHECK_OK( - File::SetContents(absl::StrCat(TestTempDir(), "/test1.proto"), + File::SetContents(absl::StrCat(::testing::TempDir(), "/test1.proto"), "syntax = \"proto3\";\n" "package foo;\n" "import \"test2.proto\";" @@ -67,7 +66,7 @@ TEST(PythonPluginTest, ImportTest) { "}\n", true)); ABSL_CHECK_OK( - File::SetContents(absl::StrCat(TestTempDir(), "/test2.proto"), + File::SetContents(absl::StrCat(::testing::TempDir(), "/test2.proto"), "syntax = \"proto3\";\n" "package foo;\n" "message Message2 {}\n", @@ -77,8 +76,8 @@ TEST(PythonPluginTest, ImportTest) { cli.SetInputsAreProtoPathRelative(true); python::Generator python_generator; cli.RegisterGenerator("--python_out", &python_generator, ""); - std::string proto_path = absl::StrCat("-I", TestTempDir()); - std::string python_out = absl::StrCat("--python_out=", TestTempDir()); + std::string proto_path = absl::StrCat("-I", ::testing::TempDir()); + std::string python_out = absl::StrCat("--python_out=", ::testing::TempDir()); const char* argv[] = {"protoc", proto_path.c_str(), "-I.", python_out.c_str(), "test1.proto"}; ASSERT_EQ(0, cli.Run(5, argv)); @@ -87,7 +86,7 @@ TEST(PythonPluginTest, ImportTest) { // ordinary Python import but do not find the string "importlib". std::string output; ABSL_CHECK_OK( - File::GetContents(absl::StrCat(TestTempDir(), "/test1_pb2.py"), + File::GetContents(absl::StrCat(::testing::TempDir(), "/test1_pb2.py"), &output, true)); std::vector lines = absl::StrSplit(output, '\n'); std::string expected_import = "import test2_pb2";