07a9de1247
* 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
|
||
---|---|---|
.. | ||
collection_loader | ||
display | ||
__init__.py | ||
test_cleanup_tmp_file.py | ||
test_context_objects.py | ||
test_encrypt.py | ||
test_helpers.py | ||
test_isidentifier.py | ||
test_shlex.py | ||
test_unsafe_proxy.py | ||
test_vars.py | ||
test_version.py |