From 08aea68d6a824282f9502fccc53e6be568dfb570 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Wed, 24 Apr 2019 22:32:08 +0300 Subject: [PATCH] Fix bug in not closing file on PyPy --- tests/test_pysnooper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_pysnooper.py b/tests/test_pysnooper.py index 28f0289..8578fb3 100644 --- a/tests/test_pysnooper.py +++ b/tests/test_pysnooper.py @@ -189,7 +189,8 @@ def test_file_output(): return y + x result = my_function('baba') assert result == 15 - output = path.open().read() + with path.open() as output_file: + output = output_file.read() assert_output( output, (