Skip to content

Commit da33e0b

Browse files
committed
tests.ctrl_tests: fix pylint warnings
1 parent e74d919 commit da33e0b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

riotctrl/tests/ctrl_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,13 @@ def test_term_cleanup(app_pidfile_env):
224224
with ctrl.run_term(logfile=sys.stdout) as child:
225225
child.expect_exact('Running')
226226
# Ensure script is started correctly
227-
content = open(tmpfile.name, 'r', encoding='utf-8').read()
228-
assert content == 'Running\n'
227+
with open(tmpfile.name, 'r', encoding='utf-8') as tempfile_r:
228+
assert tempfile_r.read() == 'Running\n'
229229

230230
# File should not exist anymore so no error to create one
231231
# File must exist to be cleaned by tempfile
232-
open(tmpfile.name, 'x')
232+
with open(tmpfile.name, 'x', encoding='utf-8'):
233+
pass
233234

234235

235236
class CtrlMock1(riotctrl.ctrl.RIOTCtrl):

0 commit comments

Comments
 (0)