diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 7b828abc9..35728c334 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -642,6 +642,9 @@ def test_source_with_decorator() -> None: src = inspect.getsource(deco_fixture) assert src == " @pytest.fixture\n def deco_fixture():\n assert False\n" + # currenly Source does not unwrap decorators, testing the + # existing behavior here for explicitness, but perhaps we should revisit/change this + # in the future assert str(Source(deco_fixture)).startswith("@functools.wraps(function)") assert str(Source(get_real_func(deco_fixture), deindent=False)) == src