1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Description: Explicitly use 'fork' instead of 'forkserver'.
Fixes FTBFS with python3.14.
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/mapproxy/mapproxy/pull/1355
--- a/mapproxy/test/conftest.py
+++ b/mapproxy/test/conftest.py
@@ -1,3 +1,8 @@
+import multiprocessing
+
+import pytest
+
+
def pytest_configure(config):
import sys
sys._called_from_pytest = True
@@ -6,3 +11,14 @@ def pytest_configure(config):
def pytest_unconfigure(config):
import sys
del sys._called_from_pytest
+
+
+@pytest.fixture(scope="session", autouse=True)
+def use_multiprocessing_fork_on_linux():
+ import sys
+ if sys.platform != "linux":
+ # Windows and macOS use 'spawn' by default
+ return
+
+ # 'forkserver' is default since Python 3.14, but can't pickle everything.
+ multiprocessing.set_start_method("fork")
|