ansible/test
Sam Doran e8d4b62b41
Fix YAML error message when error is at the end of the file (#73241)
* Fix YAML error message when error is at the end of the file

If a YAML file fails to load due to a syntax error in a file, or there is an error in the last line of a
file, PyYAML reports the last line number of the file as the index where the error occurred.

When reading the file lines, we use that index to the get the relevant line.  If the index value is out
of range, the relevant line is lost for error reporting.

Subtract one from the index value to avoid the IndexError in this specific scenario. It is possible
to still get an IndexError, which will be handled as it is currently.

* Update existing tests and add new tests
2021-01-19 10:07:36 -05:00
..
ansible_test
integration Use a pty for local connections (#73023) 2021-01-18 16:02:04 -05:00
lib/ansible_test update rstcheck and sphinx versions in contraints (#73176) 2021-01-14 13:50:44 -06:00
sanity Document install_python_apt option of apt_repository (#72959) 2021-01-08 11:30:23 -06:00
support Various intentional tests (#72485) 2020-11-06 08:41:41 -06:00
units Fix YAML error message when error is at the end of the file (#73241) 2021-01-19 10:07:36 -05:00
utils/shippable [devel] Azure Pipelines configuration. 2020-12-02 13:40:01 -08:00