summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch
diff options
context:
space:
mode:
authorTom Geelen <t.f.g.geelen@gmail.com>2025-11-25 21:20:49 +0100
committerKhem Raj <raj.khem@gmail.com>2025-11-25 15:32:29 -0800
commit65bcb2d65cc515bd5f0572f4bf3ac075bf62e5bb (patch)
treec51f9cf27ca0c5d476e77b7c05cc71ee14f7c5ac /meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch
parent5489b73633cd2971e888f9b06d48d49cbe16bf39 (diff)
downloadmeta-openembedded-65bcb2d65cc515bd5f0572f4bf3ac075bf62e5bb.tar.gz
new recipe: python3-pytest-picked
Sorry for the additional email. The previous patch still contained an erroneous line. Description: Run the tests related to the changed files Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch b/meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch
new file mode 100644
index 0000000000..dfb50ace75
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pytest-picked/0001-adjust-failing-tests-to-capture-only-ptest-output.patch
@@ -0,0 +1,50 @@
1From b9341394314e5dcaca0aa1d91fc3af28c64db387 Mon Sep 17 00:00:00 2001
2From: Tom Geelen <t.f.g.geelen@gmail.com>
3Date: Tue, 25 Nov 2025 20:42:15 +0100
4Subject: [PATCH] adjust failing tests to capture only ptest output
5
6The tests should only check for warnings emitted by the plugin itself,
7not for any other warnings that may be emitted by other plugins or pytest
8itself.
9
10Signed-off-by: Tom Geelen <t.f.g.geelen@gmail.com>
11Upstream-Status: Inappropriate [OE specific]
12---
13 tests/test_pytest_picked.py | 17 ++++++++++++++---
14 1 file changed, 14 insertions(+), 3 deletions(-)
15
16diff --git a/tests/test_pytest_picked.py b/tests/test_pytest_picked.py
17index fb2bedb..947b43a 100644
18--- a/tests/test_pytest_picked.py
19+++ b/tests/test_pytest_picked.py
20@@ -182,8 +182,13 @@ def test_should_accept_branch_as_mode(testdir, tmpdir, recwarn):
21 "Changed test folders... 0. []",
22 ]
23 )
24- assert len(recwarn) == 1
25- assert str(recwarn[0].message) == "Now `main` is the default parent branch"
26+ # Only count the plugin's own UserWarning about default parent branch
27+ plugin_warnings = [
28+ w
29+ for w in recwarn
30+ if w.category is UserWarning and "default parent branch" in str(w.message)
31+ ]
32+ assert len(plugin_warnings) == 1
33
34
35 def test_should_accept_unstaged_as_mode(testdir, tmpdir, recwarn):
36@@ -211,7 +216,13 @@ def test_should_accept_unstaged_as_mode(testdir, tmpdir, recwarn):
37 "Changed test folders... 0. []",
38 ]
39 )
40- assert len(recwarn) == 0
41+ # Ignore unrelated deprecation warnings from other plugins
42+ plugin_warnings = [
43+ w
44+ for w in recwarn
45+ if w.category is UserWarning and "default parent branch" in str(w.message)
46+ ]
47+ assert len(plugin_warnings) == 0
48
49
50 def test_should_not_run_the_tests_if_mode_is_invalid(testdir, tmpdir):