Skip to contentSkip to conversation

test_vdkr_registry: fix test_image_requires_subcommand

PATCH In review Tim Orling 2 participants 2 messages Apr 28

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/1 test_vdkr_registry: fix test_image_requires_subcommand

vdkr.run() merges stderr into stdout (see conftest.py), so the error message ends up in result.stdout even though the script writes it to stderr (>&2).

---
 tests/test_vdkr_registry.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/test_vdkr_registry.py +5 -1
index 9073444d..72a27169 100644
@@ -259,7 +259,11 @@ class TestImageCompoundCommands:
         """Test that 'image' without subcommand shows error."""
         result = self.vdkr.run("image", check=False)
         assert result.returncode != 0
-        assert "subcommand" in result.stderr.lower() or "requires" in result.stderr.lower()
+        # vdkr.run() merges stderr into stdout (see conftest.py), so the
+        # error message ends up in result.stdout even though the script
+        # writes it to stderr (>&2).
+        combined = (result.stdout + result.stderr).lower()
+        assert "subcommand" in combined or "requires" in combined
 
 
 class TestRegistryCLIOverride:
Signature · 1 line
2.50.1 (Apple Git-155)
#1 lore raw

merged.

Bruce

In message: [meta-virtualization][PATCH] test_vdkr_registry: fix test_image_requires_subcommand

Quoted 39 lines · on 27/04/2026 Tim Orling via lists.yoctoproject.org wrote:

vdkr.run() merges stderr into stdout (see conftest.py), so the error message ends up in result.stdout even though the script writes it to stderr (>&2).

---
 tests/test_vdkr_registry.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/test_vdkr_registry.py +5 -1
index 9073444d..72a27169 100644
@@ -259,7 +259,11 @@ class TestImageCompoundCommands:
         """Test that 'image' without subcommand shows error."""
         result = self.vdkr.run("image", check=False)
         assert result.returncode != 0
-        assert "subcommand" in result.stderr.lower() or "requires" in result.stderr.lower()
+        # vdkr.run() merges stderr into stdout (see conftest.py), so the
+        # error message ends up in result.stdout even though the script
+        # writes it to stderr (>&2).
+        combined = (result.stdout + result.stderr).lower()
+        assert "subcommand" in combined or "requires" in combined
 
 
 class TestRegistryCLIOverride:
Signature · 11 lines
2.50.1 (Apple Git-155)



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9748): https://lists.yoctoproject.org/g/meta-virtualization/message/9748
Mute This Topic: https://lists.yoctoproject.org/mt/119041586/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-