You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units/module_utils
Martin Krizek 600c1e67b4
Exceptions clean up (#85176)
* replace usage of `IOError` as it is an alias to `OSError`
* replace usage of `socket.error` as it is an alias to `OSError`
* use subclasses of `OSError` rather than inspecting `errno`s
* utilize `exist_ok` parameter of `os.makedirs` rather than ignoring
  `FileExistsError`

Make the following changes to the exception handling this patch already
updates to be consistent with the new code:
* use `ex` as a name for exception being handled
* use `from ex` when re-raising exception for additional context
* use f-strings and `!r` for quoting
* pass exceptions to the `exception` parameter of `fail_json`
* use `display.error_as_warning` rather than passing stringified
  exception into `display.warning`

Co-authored-by: Matt Clay <matt@mystile.com>
6 months ago
..
_internal adjust PluginInfo to use PluginType enum (#85277) 6 months ago
basic Exceptions clean up (#85176) 6 months ago
common Add missing warning methods and args (#85225) 7 months ago
compat 🔥 Remove Python 2 datetime compat fallbacks 9 months ago
datatag adjust PluginInfo to use PluginType enum (#85277) 6 months ago
facts Exceptions clean up (#85176) 6 months ago
json_utils Remove Python 2.x compat from unit tests (#82109) 2 years ago
parsing Fixed broken tests (#84088) 1 year ago
urls Exceptions clean up (#85176) 6 months ago
__init__.py Add empty-init code-smell script. (#18406) 9 years ago
conftest.py Templating overhaul, implement Data Tagging (#84621) 8 months ago
test_api.py Require `from __future__ import annotations` (#81902) 2 years ago
test_connection.py Require `from __future__ import annotations` (#81902) 2 years ago
test_distro.py Remove unused/unreachable unit test code (#82160) 2 years ago
test_text.py Remove Python 2 compat (via six) from unit tests 2 years ago