ansible/test/units
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
..
_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 Update ansible doc formats (#71070) 2020-08-05 10:53:25 -07:00
compat
config Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
errors
executor fix internal cases of actions calling unqualified module names (#70818) 2020-07-23 09:02:57 -07:00
galaxy Improve ansible-galaxy STDOUT messages for collections (#70040) 2020-06-29 15:18:30 -04:00
inventory Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
inventory_test_data/group_vars
mock Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00
module_utils AnsibleVaultEncryptedUnicode should be considered a string (#71609) 2020-09-03 14:54:00 -05:00
modules sanity: remove ansible-bad-function (#70431) 2020-07-07 11:46:28 -04:00
parsing Add more include and yaml parsing tests (#70506) 2020-08-04 11:24:52 -07:00
playbook Remove duplicate unit test (#71488) 2020-08-27 15:55:30 -04:00
plugins powershell - fix nested CLIXML parser (#71412) 2020-08-26 07:06:19 +10:00
regex
template
utils fix coverage output from synthetic packages (#71727) 2020-09-14 09:14:23 -07:00
vars
__init__.py Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
requirements.txt Remove unnecessary unit test requirements. 2020-03-23 11:14:21 -05:00
test_constants.py Remove some constants.py deprecated items (#70466) 2020-07-07 18:41:19 -05:00
test_context.py Clean up unit test boilerplate. 2020-06-22 14:20:33 -07:00