From 86c38f21530de4dc50820721803e0c918cf1b857 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 8 Dec 2021 10:22:18 +0100
Subject: [PATCH] Test ExportToPythonAndBack: don't duplicate code output

---
 Tests/Functional/PyEmbedded/Tests.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Tests/Functional/PyEmbedded/Tests.cpp b/Tests/Functional/PyEmbedded/Tests.cpp
index 959b0081a7d..d26c516144d 100644
--- a/Tests/Functional/PyEmbedded/Tests.cpp
+++ b/Tests/Functional/PyEmbedded/Tests.cpp
@@ -375,7 +375,10 @@ TEST_F(PyEmbedded, ExportToPythonAndBack)
 
     std::unique_ptr<MultiLayer> sample2(sample1->clone());
     const std::string code2 = Py::Export::sampleCode(*sample2);
-    std::cout << "Test ExportToPythonAndBack: code2:\n" << code2 << std::endl;
+    if (code2 != code1)
+        std::cout << "Test ExportToPythonAndBack: code2:\n" << code2 << std::endl;
+    else
+        std::cout << "Test ExportToPythonAndBack: code2 = code1" << std::endl;
     EXPECT_TRUE(code2 == code1);
 
     const std::string snippet =
@@ -383,8 +386,10 @@ TEST_F(PyEmbedded, ExportToPythonAndBack)
     const auto sample3 =
         Py::Import::createFromPython(snippet, "get_sample", BABuild::buildLibDir());
     const std::string code3 = Py::Export::sampleCode(*sample3);
-    std::cout << "Test ExportToPythonAndBack: code3:\n" << code3 << std::endl;
-
+    if (code3 != code1)
+        std::cout << "Test ExportToPythonAndBack: code3:\n" << code3 << std::endl;
+    else
+        std::cout << "Test ExportToPythonAndBack: code3 = code1" << std::endl;
     EXPECT_TRUE(code3 == code1);
 }
 
-- 
GitLab