google / mobly

E2E test framework for tests with complex environment requirements.
https://github.com/google/mobly
Apache License 2.0
647 stars 179 forks source link

yaml.load_all is unsafe with default loader #561

Closed winterfroststrom closed 5 years ago

winterfroststrom commented 5 years ago

tests/mobly/output_test.py::OutputTest::test_teardown_class_output T:\src\github\mobly\tests\mobly\output_test.py:258: YAMLLoadWarning: Calling yaml.load_all() without Loader=... is deprecated. The default Loader is unsafe. *** Please read https://msg.pyyaml.org/load for full details. for entry in yaml.load_all(f):

tests/mobly/records_test.py::RecordsTest::test_summary_user_data T:\src\github\mobly\tests\mobly\records_test.py:401: YAMLLoadWarning: Calling yaml.load_all() without Loader=... is deprecated. The default Loader is unsafe. *** Please read https://msg.pyyaml.org/load for full details. for c in yaml.load_all(f):

tests/mobly/records_test.py::RecordsTest::test_summary_write_dump T:\src\github\mobly\tests\mobly\records_test.py:364: YAMLLoadWarning: Calling yaml.load() without Loader=... is deprecated. The default Loader is unsafe. *** Please read https://msg.pyyaml.org/load for full details. content = yaml.load(f)

tests/mobly/records_test.py::RecordsTest::test_summary_write_dump_with_unicode T:\src\github\mobly\tests\mobly\records_test.py:383: YAMLLoadWarning: Calling yaml.load() without Loader=... is deprecated. The default Loader is unsafe. *** Please read https://msg.pyyaml.org/load for full details. content = yaml.load(f)

tests/mobly/test_runner_test.py::TestRunnerTest::test_summary_file_entries T:\src\github\mobly\tests\mobly\test_runner_test.py:135: YAMLLoadWarning: Calling yaml.load_all() without Loader=... is deprecated. The default Loader is unsafe. *** Please read https://msg.pyyaml.org/load for full details. summary_entries = list(yaml.load_all(f))

xpconanfan commented 5 years ago

The alternative API was only added a week ago https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

So let's wait for now.

xpconanfan commented 5 years ago

Using safe_load instead since the new APIs in pyyaml are probably not gonna be available internally any time soon..