From 55099e57c37778fcb585ecdb2f1469ac7131a1f9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 19 May 2020 19:19:53 -0300 Subject: [PATCH] Add requested comment as per review --- testing/code/test_source.py | 3 +++ 1 file changed, 3 insertions(+) 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