Skip to content

Commit 662f5a6

Browse files
author
Hugo Osvaldo Barrera
committed
Close files properly
1 parent 6bdbc7f commit 662f5a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def test_xdg_nonexistant(runner):
3131

3232
def test_xdg_existant(runner, tmpdir, config):
3333
with tmpdir.mkdir('todoman').join('todoman.conf').open('w') as f:
34-
f.write(config.open().read())
34+
with config.open() as c:
35+
f.write(c.read())
3536

3637
with patch('xdg.BaseDirectory.xdg_config_dirs', [str(tmpdir)]):
3738
result = CliRunner().invoke(

0 commit comments

Comments
 (0)