From fc1c015c6b79ead0d76793cf0b7ae155b365f3a6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 12 Nov 2019 14:42:10 +0100 Subject: [PATCH] tests: remove test_nested_marks (xfail) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It currently fails with a TypeError, and was not updated since 2013 - therefore it can be assumed that it is not important to support it. ``` ____________________ ERROR collecting test_nested_marks.py _____________________ …/Vcs/pluggy/src/pluggy/hooks.py:286: in __call__ return self._hookexec(self, self.get_hookimpls(), kwargs) …/Vcs/pluggy/src/pluggy/manager.py:93: in _hookexec return self._inner_hookexec(hook, methods, kwargs) …/Vcs/pluggy/src/pluggy/manager.py:337: in traced_hookexec return outcome.get_result() …/Vcs/pluggy/src/pluggy/manager.py:335: in outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs)) …/Vcs/pluggy/src/pluggy/manager.py:87: in firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, …/Vcs/pytest/src/_pytest/python.py:235: in pytest_pycollect_makeitem res = list(collector._genfunctions(name, obj)) …/Vcs/pytest/src/_pytest/python.py:404: in _genfunctions self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc)) …/Vcs/pluggy/src/pluggy/hooks.py:324: in call_extra return self(**kwargs) …/Vcs/pluggy/src/pluggy/hooks.py:286: in __call__ return self._hookexec(self, self.get_hookimpls(), kwargs) …/Vcs/pluggy/src/pluggy/manager.py:93: in _hookexec return self._inner_hookexec(hook, methods, kwargs) …/Vcs/pluggy/src/pluggy/manager.py:337: in traced_hookexec return outcome.get_result() …/Vcs/pluggy/src/pluggy/manager.py:335: in outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs)) …/Vcs/pluggy/src/pluggy/manager.py:87: in firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, …/Vcs/pytest/src/_pytest/python.py:130: in pytest_generate_tests metafunc.parametrize(*marker.args, **marker.kwargs) …/Vcs/pytest/src/_pytest/python.py:965: in parametrize function_definition=self.definition, …/Vcs/pytest/src/_pytest/mark/structures.py:111: in _for_parametrize if len(param.values) != len(argnames): E TypeError: object of type 'MarkDecorator' has no len() !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! ``` --- testing/python/metafunc.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 5becb0f8c..15c146e90 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1538,27 +1538,6 @@ class TestMarkersWithParametrization: assert len(skipped) == 0 assert len(fail) == 0 - @pytest.mark.xfail(reason="is this important to support??") - def test_nested_marks(self, testdir): - s = """ - import pytest - mastermark = pytest.mark.foo(pytest.mark.bar) - - @pytest.mark.parametrize(("n", "expected"), [ - (1, 2), - mastermark((1, 3)), - (2, 3), - ]) - def test_increment(n, expected): - assert n + 1 == expected - """ - items = testdir.getitems(s) - assert len(items) == 3 - for mark in ["foo", "bar"]: - assert mark not in items[0].keywords - assert mark in items[1].keywords - assert mark not in items[2].keywords - def test_simple_xfail(self, testdir): s = """ import pytest