ansible/test/units
Sam Doran e75570ba83
[stable-2.10] Fix YAML error message when error is at the end of the file (#73241) (#73296)
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
(cherry picked from commit e8d4b62b41)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-02-07 17:56:17 -06:00
..
_vendor transparent downstream vendoring (#69850) 2020-06-15 16:22:25 -07:00
ansible_test Add Azure Pipelines support to ansible-test. 2020-06-11 14:57:42 -07:00
cli Remove ansible-galaxy login (#72288) (#72320) 2020-10-26 14:31:52 -05:00
compat Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
config [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
errors [stable-2.10] Fix YAML error message when error is at the end of the file (#73241) (#73296) 2021-02-07 17:56:17 -06:00
executor fix internal cases of actions calling unqualified module names (#70818) (#70840) 2020-07-23 10:29:09 -07:00
galaxy Remove ansible-galaxy login (#72288) (#72320) 2020-10-26 14:31:52 -05:00
inventory [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
inventory_test_data/group_vars
mock [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
module_utils [stable-2.10] facts - properly report virtualization facts for Linux guests on bhyve (#73204). (#73233) 2021-02-07 17:50:49 -06:00
modules [stable-2.10] iptables: Reorder comment postition (#71496) (#72548) 2020-12-07 17:34:32 -06:00
parsing [stable-2.10] Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) (#70791) 2020-07-22 18:25:38 -07:00
playbook [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
plugins powershell - fix nested CLIXML parser (#71412) (#71451) 2020-08-28 09:54:14 -07:00
regex Add toggle to control invalid character substitution in group names (#52748) 2019-03-06 11:49:40 -05:00
template Do not treat AnsibleUndefined as being unsafe (#65202) 2019-11-25 15:06:29 +01:00
utils Add deprecation collection name to plugin options (#71735) (#72081) 2020-10-21 15:58:51 -05:00
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 2019-11-06 08:14:29 -08:00
__init__.py
requirements.txt Remove unnecessary unit test requirements. 2020-03-23 11:14:21 -05:00
test_constants.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_context.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00