• Eric Appelt's avatar
    bpo-29514: Check magic number for bugfix release (#54) · d6d344d8
    Eric Appelt yazdı
    * 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
    d6d344d8
test_util.py 30.6 KB