ansible/test
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
..
ansible_test
integration psrp - fix hang when copying an empty file (#71649) (#71651) 2020-09-28 00:28:01 -05:00
lib/ansible_test [2.10] updates intersphinx references for docs links (#71921) (#71945) 2020-09-25 13:53:44 -05:00
sanity powershell - fix quoting values (#71411) (#71449) 2020-08-28 12:22:22 -05:00
support Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00
units fix coverage output from synthetic packages (#71727) (#71748) 2020-09-28 00:29:24 -05:00
utils/shippable Remove temporary migration hack from CI scripts. 2020-06-16 11:25:39 -07:00