mirror of
https://github.com/codespell-project/codespell.git
synced 2025-08-26 03:11:03 +08:00
FIX: More newline
This commit is contained in:
@ -218,13 +218,13 @@ def test_custom_regex():
|
||||
def test_exclude_file():
|
||||
"""Test exclude file functionality"""
|
||||
with TemporaryDirectory() as d:
|
||||
with open(op.join(d, 'bad.txt'), 'w', newline='\n') as f:
|
||||
f.write('abandonned 1\nabandonned 2\n')
|
||||
with open(op.join(d, 'bad.txt'), 'wb') as f:
|
||||
f.write('abandonned 1\nabandonned 2\n'.encode('utf-8'))
|
||||
assert_equal(cs.main(d), 2)
|
||||
with tempfile.NamedTemporaryFile('w') as f:
|
||||
pass
|
||||
with open(f.name, 'w', newline='\n') as f:
|
||||
f.write('abandonned 1\n')
|
||||
with open(f.name, 'wb') as f:
|
||||
f.write('abandonned 1\n'.encode('utf-8'))
|
||||
assert_equal(cs.main(d), 2)
|
||||
assert_equal(cs.main('-x', f.name, d), 1)
|
||||
|
||||
|
Reference in New Issue
Block a user