mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 02:14:04 +00:00
Massaging some code
This commit is contained in:
parent
d7d3a80c16
commit
78a539a2a5
3 changed files with 9 additions and 10 deletions
|
|
@ -1175,7 +1175,7 @@ def test_custom_repr():
|
|||
)
|
||||
|
||||
|
||||
def test_activate_deactivate_snoop():
|
||||
def test_disable():
|
||||
string_io = io.StringIO()
|
||||
|
||||
def my_function(foo):
|
||||
|
|
@ -1183,11 +1183,8 @@ def test_activate_deactivate_snoop():
|
|||
y = 8
|
||||
return x + y
|
||||
|
||||
pysnooper.tracer.DISABLED = '1'
|
||||
with pysnooper.snoop(string_io):
|
||||
result = my_function('baba')
|
||||
with mini_toolbox.TempValueSetter((pysnooper.tracer, 'DISABLED'), True):
|
||||
with pysnooper.snoop(string_io):
|
||||
result = my_function('baba')
|
||||
output = string_io.getvalue()
|
||||
assert output == ""
|
||||
|
||||
pysnooper.tracer.DISABLED = ''
|
||||
test_string_io()
|
||||
assert not output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue