do not shadow variables in command tests

As part of the tests of the dump plugins a variable was shadowed. By
that, one branch of the test was not executed.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-05-04 04:32:43 +02:00 committed by Jan Kiszka
parent 4015a6b384
commit bb2148016b

View File

@ -98,8 +98,8 @@ def test_dump(changedir, tmpdir, capsys):
if r == '--resolve-env':
del os.environ['TESTVAR_FOO']
with open(outfile, 'w') as f:
f.write(capsys.readouterr().out)
with open(outfile, 'w') as file:
file.write(capsys.readouterr().out)
with open(outfile, 'r') as cf:
flatconf = json.load(cf) if f == 'json' else yaml.safe_load(cf)