mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
Simplify the tests
This commit is contained in:
parent
b64436cdda
commit
a99475afa0
14 changed files with 144 additions and 201 deletions
|
|
@ -40,11 +40,8 @@ TESTS = (
|
|||
|
||||
@pytest.mark.parametrize(('input_s', 'output', 'expected_retval'), TESTS)
|
||||
def test_rewrite(input_s, output, expected_retval, tmpdir):
|
||||
tmpfile = tmpdir.join('file.txt')
|
||||
|
||||
with open(tmpfile.strpath, 'w') as f:
|
||||
f.write(input_s)
|
||||
|
||||
retval = main([tmpfile.strpath])
|
||||
assert tmpfile.read() == output
|
||||
path = tmpdir.join('file.txt')
|
||||
path.write(input_s)
|
||||
retval = main([path.strpath])
|
||||
assert path.read() == output
|
||||
assert retval == expected_retval
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue