Simplify the tests
diff --git a/tests/check_docstring_first_test.py b/tests/check_docstring_first_test.py
index f57e695..f14880b 100644
--- a/tests/check_docstring_first_test.py
+++ b/tests/check_docstring_first_test.py
@@ -1,8 +1,6 @@
from __future__ import absolute_import
from __future__ import unicode_literals
-import io
-
import pytest
from pre_commit_hooks.check_docstring_first import check_docstring_first
@@ -59,9 +57,7 @@
@all_tests
def test_integration(tmpdir, capsys, contents, expected, expected_out):
- tmpfilename = tmpdir.join('test.py').strpath
- with io.open(tmpfilename, 'w') as tmpfile:
- tmpfile.write(contents)
-
- assert main([tmpfilename]) == expected
- assert capsys.readouterr()[0] == expected_out.format(filename=tmpfilename)
+ f = tmpdir.join('test.py')
+ f.write(contents)
+ assert main([f.strpath]) == expected
+ assert capsys.readouterr()[0] == expected_out.format(filename=f.strpath)