Package: src:python-syrupy
Version: 5.5.3-1
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that TODO fails to build from source [1].
The problem is showing in a test against pytest-xdist, upstream set this
test as xfail as syrupy is "not currently compatible with xdist"[2], but
it seems to me that the problem is that it causes an unexpected order in
the execution, so the results are almost always out of order, and thanks
to Murphy, in my rebuild it was in the "correct" order thus making the
test to pass which makes the xfail to fail (clear, right?). oO

I created two different patches because I wasn't satisfied with my first
take, the first one simply ignores the test (which I still consider
flaky). The second one checks the results taking into account that the
results of the workers varies. I'm attaching both.

I applied the first patch in the sandbox [3] to be able to build the
packages that depend on python-syrupy, please consider applying one the
proposed patches to support the upcoming 3.15 version. Also, please
consider forwarding the patch you consider more appropriate.

Happy hacking,

[1]: 
https://debusine.debian.net/debian/r-python-python3.15/work-request/1097140/
[2]: https://github.com/syrupy-project/syrupy/blob/main/tests/conftest.py#L24
[3]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Mark xdist xfail as non-strict to avoid XPASS failures
Forwarded: not-needed

Index: python-syrupy/tests/conftest.py
===================================================================
--- python-syrupy.orig/tests/conftest.py
+++ python-syrupy/tests/conftest.py
@@ -21,7 +21,7 @@ def plugin_args(request: pytest.FixtureR
         _XDIST_ZERO,
         pytest.param(
             _XDIST_TWO,
-            marks=pytest.mark.xfail(reason="Not currently compatible with xdist"),
+            marks=pytest.mark.xfail(reason="Not currently compatible with xdist", strict=False),
         ),
     ],
     ids=["no_plugin", "xdist_zero", "xdist_two"],
Description: Make xdist snapshot diff assertions order independent
Author: Maximiliano Curia <[email protected]>
Forwarded: no
Last-Update: 2026-08-25

Index: python-syrupy/tests/integration/test_snapshot_option_update.py
===================================================================
--- python-syrupy.orig/tests/integration/test_snapshot_option_update.py
+++ python-syrupy/tests/integration/test_snapshot_option_update.py
@@ -121,65 +121,77 @@ def run_testcases(testdir, testcases_ini
 
 
 def test_update_failure_shows_snapshot_diff(
-    run_testcases, testcases_updated, plugin_args_fails_xdist
+    run_testcases, testcases_updated, plugin_args
 ):
     testdir = run_testcases[1]
     testdir.makepyfile(**testcases_updated)
-    result = testdir.runpytest("-vv", *plugin_args_fails_xdist)
-    result.stdout.re_match_lines(
+    result = testdir.runpytest("-vv", *plugin_args)
+    # under xdist the failure blocks are reported in worker completion order,
+    # so their relative order varies.
+    for expected_lines in (
         (
-            r".*assert snapshot == \['this', 'will', 'not', 'match'\]",
-            r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
-            r".*    list\(\[",
-            r".*     ...",
-            r".*      'will',",
-            r".*  -   'be',",
-            r".*  -   'updated',",
-            r".*  \+   'not',",
-            r".*  \+   'match',",
-            r".*    \]",
-            r".*assert \['this', 'will', 'fail'\] == snapshot",
-            r".*AssertionError: assert \[\+ received\] == \[- snapshot\]",
-            r".*    list\(\[",
-            r".*     ...",
-            r".*      'will',",
-            r".*  -   'be',",
-            r".*  \+   'fail',",
-            r".*  -   'updated',",
-            r".*    \]",
-            r".*assert snapshot == \['this', 'will', 'be', 'too', 'much'\]",
-            r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
-            r".*    list\(\[",
-            r".*     ...",
-            r".*      'be',",
-            r".*  -   'updated',",
-            r".*  \+   'too',",
-            r".*  \+   'much',",
-            r".*    \]",
-            r".*assert snapshot == \"sing line changeling\"",
-            r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
-            r".*  - 'single line change'",
-            r".*  \+ 'sing line changeling'",
-            r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
-            r".*    '",
-            r".*      ...",
-            r".*        multiple line changes",
-            r".*  -     with some lines staying the same",
-            r".*  \+     with some lines not staying the same",
-            r".*  -     intermittent changes that have to be ignore by the differ out",
-            r".*  \+     intermittent changes so unchanged lines have to be ignored b",
-            r".*  -     because when there are a lot of changes you only want to see ",
-            r".*  \+     cause when there are a lot of changes you only want to see w",
-            r".*        you do not want to see this line",
-            r".*      ...",
-            r".*    ",
-            r".*  -     \[38;5;1mthis line should show up because it changes color",
-            r".*  \+     \[38;5;3mthis line should show up because it changes color",
-            r".*  \+     and this line does not exist in the first one",
-            r".*        ",
-            r".*    '",
-        )
-    )
+                r".*assert snapshot == \['this', 'will', 'not', 'match'\]",
+                r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
+                r".*    list\(\[",
+                r".*     ...",
+                r".*      'will',",
+                r".*  -   'be',",
+                r".*  -   'updated',",
+                r".*  \+   'not',",
+                r".*  \+   'match',",
+                r".*    \]",
+        ),
+        (
+                r".*assert \['this', 'will', 'fail'\] == snapshot",
+                r".*AssertionError: assert \[\+ received\] == \[- snapshot\]",
+                r".*    list\(\[",
+                r".*     ...",
+                r".*      'will',",
+                r".*  -   'be',",
+                r".*  \+   'fail',",
+                r".*  -   'updated',",
+                r".*    \]",
+        ),
+        (
+                r".*assert snapshot == \['this', 'will', 'be', 'too', 'much'\]",
+                r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
+                r".*    list\(\[",
+                r".*     ...",
+                r".*      'be',",
+                r".*  -   'updated',",
+                r".*  \+   'too',",
+                r".*  \+   'much',",
+                r".*    \]",
+        ),
+        (
+                r".*assert snapshot == \"sing line changeling\"",
+                r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
+                r".*  - 'single line change'",
+                r".*  \+ 'sing line changeling'",
+        ),
+        (
+            r".*assert snapshot == '''",
+                r".*AssertionError: assert \[- snapshot\] == \[\+ received\]",
+                r".*    '",
+                r".*      ...",
+                r".*        multiple line changes",
+                r".*  -     with some lines staying the same",
+                r".*  \+     with some lines not staying the same",
+                r".*  -     intermittent changes that have to be ignore by the differ out",
+                r".*  \+     intermittent changes so unchanged lines have to be ignored b",
+                r".*  -     because when there are a lot of changes you only want to see ",
+                r".*  \+     cause when there are a lot of changes you only want to see w",
+                r".*        you do not want to see this line",
+                r".*      ...",
+                r".*    ",
+                r".*  -     \[38;5;1mthis line should show up because it changes color",
+                r".*  \+     \[38;5;3mthis line should show up because it changes color",
+                r".*  \+     and this line does not exist in the first one",
+                r".*        ",
+                r".*    '",
+        ),
+    ):
+        result.stdout.re_match_lines(expected_lines)
     assert result.ret == 1
 
 

Reply via email to