ansible/test/units
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
..
_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 [stable-2.10] Update ansible doc formats (#71070) (#71111) 2020-08-27 13:33:24 -05:00
compat
config [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 2019-11-05 09:12:11 -08:00
executor fix internal cases of actions calling unqualified module names (#70818) (#70840) 2020-07-23 10:29:09 -07:00
galaxy [2.10] Improve ansible-galaxy STDOUT messages for collections (#70379) 2020-07-17 12:39:16 -07:00
inventory [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
inventory_test_data/group_vars
mock [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
module_utils Attempt at reverting CVE-2020-1736 changes [2.10] (#71514) 2020-09-01 01:00:26 -05:00
modules [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
parsing [stable-2.10] Ensure single vaulted values aren't counted as sequences. Fixes #70784 (#70786) (#70791) 2020-07-22 18:25:38 -07:00
playbook [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
plugins powershell - fix nested CLIXML parser (#71412) (#71451) 2020-08-28 09:54:14 -07:00
regex Add toggle to control invalid character substitution in group names (#52748) 2019-03-06 11:49:40 -05:00
template Do not treat AnsibleUndefined as being unsafe (#65202) 2019-11-25 15:06:29 +01:00
utils fix coverage output from synthetic packages (#71727) (#71748) 2020-09-28 00:29:24 -05:00
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 2019-11-06 08:14:29 -08:00
__init__.py
requirements.txt Remove unnecessary unit test requirements. 2020-03-23 11:14:21 -05:00
test_constants.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00
test_context.py [stable-2.10] Clean up unit test boilerplate. 2020-07-13 18:28:02 -07:00