From a32206b3650c5ce18c0a06eb0eb40abc8becfa58 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 10 Sep 2015 15:41:26 +0200 Subject: [PATCH] Documented that the parallel test runner doesn't work on Windows. --- docs/ref/django-admin.txt | 3 ++- docs/releases/1.9.txt | 7 ++++--- tests/runtests.py | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index dff48ac4609..26702d7db74 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1289,7 +1289,8 @@ correctly: $ pip install tblib -This feature isn't available on Oracle. +This feature isn't available on Windows. It doesn't work with the Oracle +database backend either. .. warning:: diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 41e7701e99a..3d256ae29dd 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -135,9 +135,10 @@ Each process gets its own database. You must ensure that different test cases don't access the same resources. For instance, test cases that touch the filesystem should create a temporary directory for their own use. -This option is enabled by default for Django's own test suite on database -backends that support it (this is all the built-in backends except for -Oracle). +This option is enabled by default for Django's own test suite provided: + +- the OS supports it (all but Windows) +- the database backend supports it (all the built-in backends but Oracle) Minor features ~~~~~~~~~~~~~~ diff --git a/tests/runtests.py b/tests/runtests.py index cfc8722ae28..4d6e22e3b23 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -236,8 +236,11 @@ def teardown(state): def actual_test_processes(parallel): if parallel == 0: + # On Python 3.4+: if multiprocessing.get_start_method() != 'fork': + if not hasattr(os, 'fork'): + return 1 # This doesn't work before django.setup() on some databases. - if all(conn.features.can_clone_databases for conn in connections.all()): + elif all(conn.features.can_clone_databases for conn in connections.all()): return default_test_processes() else: return 1