From e3e09d31b5b429016f1c42001091ac6aff2855b5 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 14 Sep 2019 13:35:18 +0300 Subject: [PATCH] Add test for decorating when DISABLED = True Fix #154 --- tests/test_pysnooper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_pysnooper.py b/tests/test_pysnooper.py index ade570c..22e5e4c 100644 --- a/tests/test_pysnooper.py +++ b/tests/test_pysnooper.py @@ -1233,8 +1233,12 @@ def test_disable(): return x + y with mini_toolbox.TempValueSetter((pysnooper.tracer, 'DISABLED'), True): - with pysnooper.snoop(string_io): + tracer = pysnooper.snoop(string_io) + with tracer: result = my_function('baba') + my_decorated_function = tracer(my_function) + my_decorated_function('booboo') + output = string_io.getvalue() assert not output