]> granicus.if.org Git - python/commit
bpo-29514: Check magic number for bugfix release (#54)
authorEric Appelt <eric.appelt@gmail.com>
Mon, 17 Apr 2017 18:35:43 +0000 (13:35 -0500)
committerŁukasz Langa <lukasz@langa.pl>
Mon, 17 Apr 2017 18:35:43 +0000 (11:35 -0700)
commitd6d344d8330a5975fc102e8f275d47044294f1d1
tree40545064052be513b6362a39a2254295207ca4cc
parent8e1ddbd592c3aaf02a58789771f891c0101c6e05
bpo-29514: Check magic number for bugfix release (#54)

* bpo-29514: Check magic number for micro release

Add a dict importlib.util.EXPECTED_MAGIC_NUMBERS which
details the initial and expected pyc magic number for
each minor release. This gives a mechanism for users to
check if the magic number has changed within a release and
for a test to ensure procedure is followed if a change is
necessary.

Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.

* Simplify magic number release test

Simplify the magic number release test by removing
EXPECTED_MAGIC_NUMBERS table and making the expected
magic number self-contained within the test.

BPO: 29514

* Improve magic number test execution and message

Improve the execution of the magic number test by
using skipUnless for alpha and beta releases, and
directly inheriting from unittest.TestCase rather than
using the machinery for the other tests. Also improve
the error message to explain the reason for caution in
changing the magic number.

BPO: 29514
Lib/test/test_importlib/test_util.py