'Check that compileall recreates bytecode when the new metadata is
used.'

@unittest.skipUnless(hasattr(os, 'stat'), 'test    needs    os.stat()')
def recreation_check(self, metadata):

    py_compile.compile(self.source_path)
    self.assertEqual(*self.data())
    with open(self.bc_path, 'rb') as file:
        bc = file.read()[len(metadata):]
    with open(self.bc_path, 'wb') as file:
        file.write(metadata)
        file.write(bc)
    self.assertNotEqual(*self.data())
    compileall.compile_dir(self.directory, force=False, quiet=True)
    self.assertTrue(*self.data())
