From 13e594a31474136fb185eff7084760f724897d6b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:35:26 +0200 Subject: [PATCH] fixup: mark mro test reformatt --- testing/test_mark.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 8c20fe8b1..6199dc0b3 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1112,23 +1112,24 @@ def test_marker_expr_eval_failure_handling(pytester: Pytester, expr) -> None: def test_mark_mro(): - @pytest.mark.xfail("a") + xfail = pytest.mark.xfail + + @xfail("a") class A: pass - @pytest.mark.xfail("b") + @xfail("b") class B: pass - @pytest.mark.xfail("c") + @xfail("c") class C(A, B): pass from _pytest.mark.structures import get_unpacked_marks - all_marks = list(get_unpacked_marks(C)) + all_marks = get_unpacked_marks(C) - nk = [(x.name, x.args[0]) for x in all_marks] - assert nk == [("xfail", "c"), ("xfail", "a"), ("xfail", "b")] + assert all_marks == [xfail("c").mark, xfail("a").mark, xfail("b").mark] - assert list(get_unpacked_marks(C, consider_mro=False)) == [] + assert get_unpacked_marks(C, consider_mro=False) == [pytest.mark.xfail("c").mark]