From ba80c884f89604c0100ce21c5435f29fa5664635 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 13 Apr 2014 22:53:54 -0700 Subject: [PATCH] Fix PyPy --- tests/trailing_whitespace_fixer_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/trailing_whitespace_fixer_test.py b/tests/trailing_whitespace_fixer_test.py index f698633..3b6a9a4 100644 --- a/tests/trailing_whitespace_fixer_test.py +++ b/tests/trailing_whitespace_fixer_test.py @@ -9,7 +9,8 @@ def test_fixes_trailing_whitespace(tmpdir): ('foo.py', 'foo \nbar \n'), ('bar.py', 'bar\t\nbaz\t\n'), ): - open(filename, 'w').write(contents) + with open(filename, 'w') as f: + f.write(contents) # pragma: no cover (python 2.6 coverage bug) ret = fix_trailing_whitespace(['foo.py', 'bar.py']) assert ret == 1