From 4ac0e974d0fae07cbeae4b1739bb89636d079a91 Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Wed, 20 Dec 2023 15:28:38 +0100 Subject: [PATCH] tests: add multiprocessing.freeze_support() call to lightning test When running the `test_lightning_mnist_autoencoder` under arm64 macOS, `multiprocessing` seems to be activated at some point, and the test gets stuck due to lack of `multiprocessing.freeze_support` call. --- src/_pyinstaller_hooks_contrib/tests/test_deep_learning.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_pyinstaller_hooks_contrib/tests/test_deep_learning.py b/src/_pyinstaller_hooks_contrib/tests/test_deep_learning.py index 0008beee..c5e7b54a 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_deep_learning.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_deep_learning.py @@ -110,6 +110,11 @@ def test_lightning_mnist_autoencoder(pyi_builder): pyi_builder.test_source(""" import os + # On macOS, multiprocessing seems to be used at some point... + if __name__ == '__main__': + import multiprocessing + multiprocessing.freeze_support() + import torch import torchvision import lightning