diff mbox series

[yocto-autobuilder-helper,1/4] scripts: send_qa_email: slightly rework previous tag test

Message ID 20231217133032.27231-2-alexis.lothore@bootlin.com
State New
Headers show
Series Fix send_qa_email for releases with new major number | expand

Commit Message

Alexis Lothoré Dec. 17, 2023, 1:30 p.m. UTC
From: Alexis Lothoré <alexis.lothore@bootlin.com>

Use intermediate variables for test input/output, and print expected
output in subtest to get more info when a test fails

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 scripts/test_send_qa_email.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py
index 5509b3c2510e..8ab91538748a 100755
--- a/scripts/test_send_qa_email.py
+++ b/scripts/test_send_qa_email.py
@@ -57,10 +57,10 @@  class TestVersion(unittest.TestCase):
 
     def test_versions(self):
         for data in self.test_data_get_version:
-            test_name = data["input"]["version"]
-            with self.subTest(f"Test {test_name} previous tag"):
-                self.assertEqual(send_qa_email.get_previous_tag(os.environ.get(
-                    "POKY_PATH"), data["input"]["version"]), data["expected"])
+            input_version = data["input"]["version"]
+            expected = data["expected"]
+            with self.subTest(f"Test {input_version} previous tag (expecting {expected})"):
+                self.assertEqual(send_qa_email.get_previous_tag(os.environ.get("POKY_PATH"), input_version), expected)
 
     def test_is_release_version(self):
         for data in self.test_data_is_release_version: