cpython/Lib/test/test_importlib
Elvis Pranskevichus a6b3ec5b6d bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in
3.7.0 in bpo-29708.  The change is bad, as it unconditionally overrides
*invalidation_mode*, even if it was passed as an explicit argument to
``py_compile.compile()`` or ``compileall``.  An environment variable
should *never* override an explicit argument to a library function.
That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH``
environment variable is set.

This changes ``py_compile.compile()`` to only look at
``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified.
I also made various relevant tests run with explicit control over the
value of ``SOURCE_DATE_EPOCH``.

While looking at this, I noticed that ``zipimport`` does not work
with hash-based .pycs _at all_, though I left the fixes for
subsequent commits.
2018-10-10 18:43:14 +02:00
..
builtin
data01
data02
data03
extension
frozen
import_
namespace_pkgs
source bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607) 2018-10-10 18:43:14 +02:00
zipdata01
zipdata02
__init__.py
__main__.py
abc.py
test_abc.py bpo-25711: Rewrite zipimport in pure Python. (GH-6809) 2018-09-18 22:22:29 +03:00
test_api.py
test_lazy.py
test_locks.py
test_namespace_pkgs.py
test_open.py
test_path.py
test_read.py
test_resource.py
test_spec.py
test_util.py bpo-29514: Make magic number test work for candidates 2018-06-26 22:36:46 -04:00
test_windows.py
util.py