tests: Fix unclosed file warnings when testing reading logs
The issue was FileResponce
was not handled properly. It was
simply discarded instead of reading from it.
Now the data is properly red from FileResponce
and it properly
closes once all data has been red.
Also remove the using .open()
on ElasticSearch and MongoDB
logs as .open()
is hacked on top of .read()
for those logs
backends.
tests/lava_rest_app/test_api.py::TestRestApi::test_testjob_logs_offset_end
/usr/lib/python3/dist-packages/django/db/models/sql/query.py:895: ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/pytest-of-root/pytest-1/test_testjob_logs0/output.yaml'>