ansible/test
Matt Davis e813b0151c
fix coverage output from synthetic packages (#71727)
* 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
2020-09-14 09:14:23 -07:00
..
ansible_test
integration Fix with_dict/with_list being passed incorrect type tests (#71699) 2020-09-11 07:53:10 +02:00
lib/ansible_test Remove em dash from the pytest configuration file 2020-09-14 09:02:48 -07:00
sanity Allow list of filters for the setup module (#68551) 2020-09-09 20:40:48 +02:00
support Remove incidental azure tests (#71164) 2020-08-08 00:56:53 -05:00
units fix coverage output from synthetic packages (#71727) 2020-09-14 09:14:23 -07:00
utils/shippable Remove incidental azure tests (#71164) 2020-08-08 00:56:53 -05:00