import zipfile
import glob
# test_dir(内のファイル含む)をZip化する(→test.zipへ)
with zipfile.ZipFile(r'C:\Users\yoshi\OneDrive\デスクトップ\test.zip', 'w') as z:
for f in glob.glob(r'C:\Users\yoshi\OneDrive\デスクトップ\test_dir\**', recursive=True):
print(f)
z.write(f)
# test_dirのZipを解凍する
with zipfile.ZipFile('test_dir.zip'):
z.extractall('unzip_dir')