ansible/test/units/utils
Matt Davis 07a9de1247
fix coverage output from synthetic packages (#71727) (#71748)
* fix coverage output from synthetic packages

* synthetic packages (eg, implicit collection packages without `__init__.py`) were always created at runtime with empty string source, which was compiled to a code object and exec'd during the package load. When run with code coverage, it created a bogus coverage entry (since the `__synthetic__`-suffixed `__file__` entry didn't exist on disk).
* modified collection loader `get_code` to preserve the distinction between `None` (eg synthetic package) and empty string (eg empty `__init__.py`) values from `get_source`, and to return `None` when the source is `None`. This allows the package loader to skip `exec`ing things that truly have no source file on disk, thus not creating bogus coverage entries, while preserving behavior and coverage reporting for empty package inits that actually exist.

* add unit test

(cherry picked from commit e813b0151c)
2020-09-28 00:29:24 -05:00
..
collection_loader fix coverage output from synthetic packages (#71727) (#71748) 2020-09-28 00:29:24 -05:00
display reset logging to INFO (#70878) (#70881) 2020-07-24 15:47:57 -05:00
__init__.py
test_cleanup_tmp_file.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_context_objects.py Unit test cleanup. (#60315) 2019-08-09 08:31:13 -07:00
test_encrypt.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_helpers.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_isidentifier.py ansible.utils.vars.isidentifier improvements (#58278) 2020-05-21 19:54:40 +02:00
test_shlex.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_unsafe_proxy.py Ensure that data within a tuple is marked as unsafe (#65918) 2020-01-07 08:41:37 -06:00
test_vars.py combine filter: fine list handling (option b) (#57894) 2020-02-12 16:40:36 -05:00
test_version.py Fix SemanticVersion comparison (#69395) 2020-05-11 11:58:15 -05:00