Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						d55979334d 
					 
					
						
						
							
							Fixed   #36531  -- Added forkserver support to parallel test runner.  
						
						
						
						
					 
					
						2025-07-29 14:11:22 -03:00 
						 
				 
			
				
					
						
							
							
								django-bot 
							
						 
					 
					
						
						
							
						
						69a93a88ed 
					 
					
						
						
							
							Refs  #36500  -- Rewrapped long docstrings and block comments via a script.  
						
						... 
						
						
						
						Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505 . 
						
						
					 
					
						2025-07-23 20:17:55 -03:00 
						 
				 
			
				
					
						
							
							
								Natalia 
							
						 
					 
					
						
						
							
						
						1a03a984ab 
					 
					
						
						
							
							Fixed   #36380  -- Deferred SQL formatting when running tests with --debug-sql.  
						
						... 
						
						
						
						Thanks to Jacob Walls for the report and previous iterations of this
fix, to Simon Charette for the logging formatter idea, and to Tim Graham
for testing and ensuring that 3rd party backends remain compatible.
This partially reverts d8f093908c#36112 , #35448 .
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com > 
						
						
					 
					
						2025-06-16 17:41:24 -03:00 
						 
				 
			
				
					
						
							
							
								Simon Charette 
							
						 
					 
					
						
						
							
						
						2d34ebe49a 
					 
					
						
						
							
							Refs  #35967  -- Deprecated BaseDatabaseCreation.create_test_db(serialize).  
						
						... 
						
						
						
						Given there are no longer any internal usages of serialize=True and it
poses a risk to non-test databases integrity it seems appropriate to
deprecate it. 
						
						
					 
					
						2025-02-16 08:43:42 +01:00 
						 
				 
			
				
					
						
							
							
								Simon Charette 
							
						 
					 
					
						
						
							
						
						dc69a63f84 
					 
					
						
						
							
							Fixed   #35967  -- Deferred test suite fixtures serialization after all dbs setup.  
						
						... 
						
						
						
						While the top-level objects fed to serialization are bound to the test
database being created nothing prevents code invoked during
serialization from performing queries against other connections entries
that haven't been swapped yet.
The reported example of that is a database router directing all reads to
a test mirror for a set of models involving auto-created many-to-many
fields. It might be tempting to address the many-to-many field case but
this a symptom of a larger problem where the test framework yields the
flow execution to user code that could interact with non-test databases
in unexpected ways.
Deferring test database fixture serialization until the point where all
connections entries have been swapped for their test equivalent ensures
that no code triggered during serialization can interact with non-test
databases.
Thanks Jake Howard for the report and Jacob Walls for the initial
investigation. 
						
						
					 
					
						2025-02-16 07:58:15 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						f5772de696 
					 
					
						
						
							
							Fixed   #36005  -- Dropped support for Python 3.10 and 3.11.  
						
						
						
						
					 
					
						2025-01-20 14:07:28 +01:00 
						 
				 
			
				
					
						
							
							
								Tim Graham 
							
						 
					 
					
						
						
							
						
						d8f093908c 
					 
					
						
						
							
							Fixed   #35448  -- Fixed formatting of test --debug-sql output.  
						
						... 
						
						
						
						Also adds DatabaseOperations.format_debug_sql() hook for backends
(e.g. NoSQL) to customize formatting. 
						
						
					 
					
						2025-01-18 07:04:57 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						2bc43ccbdb 
					 
					
						
						
							
							Removed redundant RemoteTestResultTest._test_error_exc_info() test hook.  
						
						
						
						
					 
					
						2024-11-11 12:31:48 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						398cec434b 
					 
					
						
						
							
							Refs  #35849  -- Skipped ParallelTestSuiteTest.test_handle_add_error_before_first_test() without tblib.  
						
						... 
						
						
						
						Follow up to 661dfdd598 
						
						
					 
					
						2024-11-11 12:31:48 +01:00 
						 
				 
			
				
					
						
							
							
								David Winiecki 
							
						 
					 
					
						
						
							
						
						661dfdd598 
					 
					
						
						
							
							Fixed   #35849  -- Made ParallelTestSuite report correct error location.  
						
						
						
						
					 
					
						2024-11-06 17:14:41 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						34066d6cf3 
					 
					
						
						
							
							Refs  #35844  -- Fixed tests for test --parallel option on Python 3.14+.  
						
						... 
						
						
						
						"forkserver" is the new default on POSIX systems, and Django doesn't
support parallel tests with "forkserver":
b65f2cdfa7 
						
						
					 
					
						2024-10-24 11:41:37 -03:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						f835787f71 
					 
					
						
						
							
							Refs  #32114  -- Fixed RemoteTestResultTest.test_unpicklable_subtest test without tblib.  
						
						... 
						
						
						
						Follow up to c09e8f5fd8 
						
						
					 
					
						2024-02-22 06:27:39 +01:00 
						 
				 
			
				
					
						
							
							
								David Wobrock 
							
						 
					 
					
						
						
							
						
						c09e8f5fd8 
					 
					
						
						
							
							Fixed   #32114  -- Fixed parallel test crash on non-picklable objects in subtests.  
						
						
						
						
					 
					
						2024-02-21 12:04:03 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						305757aec1 
					 
					
						
						
							
							Applied Black's 2024 stable style.  
						
						... 
						
						
						
						https://github.com/psf/black/releases/tag/24.1.0  
					
						2024-01-26 12:45:07 +01:00 
						 
				 
			
				
					
						
							
							
								David Sanders 
							
						 
					 
					
						
						
							
						
						a5905b164d 
					 
					
						
						
							
							Fixed   #34825  -- Avoided setting unused connections when initializing parallel workers.  
						
						
						
						
					 
					
						2023-09-25 10:14:55 +02:00 
						 
				 
			
				
					
						
							
							
								David Smith 
							
						 
					 
					
						
						
							
						
						74b5074174 
					 
					
						
						
							
							Fixed   #34210  -- Added unittest's durations option to the test runner.  
						
						
						
						
					 
					
						2023-08-31 07:14:58 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						dd45d5223b 
					 
					
						
						
							
							Fixed ResourceWarning from unclosed SQLite connection on Python 3.13+.  
						
						... 
						
						
						
						- backends.sqlite.tests.ThreadSharing.test_database_sharing_in_threads
- backends.tests.ThreadTests.test_default_connection_thread_local:
    on SQLite, close() doesn't explicitly close in-memory connections.
- servers.tests.LiveServerInMemoryDatabaseLockTest
- test_runner.tests.SQLiteInMemoryTestDbs.test_transaction_support
Check out https://github.com/python/cpython/pull/108015 . 
						
						
					 
					
						2023-08-23 09:09:23 +02:00 
						 
				 
			
				
					
						
							
							
								konsti 
							
						 
					 
					
						
						
							
						
						48a1929ca0 
					 
					
						
						
							
							Removed unnecessary trailing commas in tests.  
						
						
						
						
					 
					
						2023-08-22 12:42:57 +02:00 
						 
				 
			
				
					
						
							
							
								David Smith 
							
						 
					 
					
						
						
							
						
						097e3a70c1 
					 
					
						
						
							
							Refs  #33476  -- Applied Black's 2023 stable style.  
						
						... 
						
						
						
						Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0  
						
						
					 
					
						2023-02-01 11:04:38 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						43b01300b7 
					 
					
						
						
							
							Refs  #32655  -- Removed extra_tests argument for DiscoverRunner.build_suite()/run_tests().  
						
						... 
						
						
						
						Per deprecation timeline. 
						
						
					 
					
						2023-01-17 11:49:15 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						6c0539ed7c 
					 
					
						
						
							
							Refs  #32446  -- Removed SERIALIZE test database setting per deprecation timeline.  
						
						
						
						
					 
					
						2023-01-17 11:49:15 +01:00 
						 
				 
			
				
					
						
							
							
								Nick Pope 
							
						 
					 
					
						
						
							
						
						2bc47d7fe9 
					 
					
						
						
							
							Avoided assignment followed by immediate return.  
						
						... 
						
						
						
						Identified using the following command:
$ pcre2grep --line-number --multiline --recursive \
    "(?s)(\n +)(\w+) = [^\n]+\1return \2;?$" \
    django docs extras js_tests scripts tests 
						
						
					 
					
						2022-10-31 12:31:13 +01:00 
						 
				 
			
				
					
						
							
							
								Giebisch 
							
						 
					 
					
						
						
							
						
						3283120cca 
					 
					
						
						
							
							Fixed   #34111  -- Made test runner with --debug-sql format SQL queries.  
						
						
						
						
					 
					
						2022-10-24 08:11:30 +02:00 
						 
				 
			
				
					
						
							
							
								Adam Johnson 
							
						 
					 
					
						
						
							
						
						0f5b11eca0 
					 
					
						
						
							
							Refs  #34010  -- Made --debug-mode work for parallel tests using spawn.  
						
						... 
						
						
						
						Bug in 3b3f38b3b0 
						
						
					 
					
						2022-09-28 19:39:25 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						41c4cb253c 
					 
					
						
						
							
							Fixed   #33719  -- Fixed test command crash when running in parallel.  
						
						... 
						
						
						
						Thanks Pēteris Caune for the report.
Regression in 3b3f38b3b0 
						
						
					 
					
						2022-05-19 10:20:51 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						2ee4caf56b 
					 
					
						
						
							
							Refs  #33173  -- Fixed test_runner/test_utils tests on Python 3.11+.  
						
						... 
						
						
						
						Python 3.11 uses fully qualified test name in unittest output. See
755be9b150 
						
						
					 
					
						2022-04-07 07:02:21 +02:00 
						 
				 
			
				
					
						
							
							
								David Smith 
							
						 
					 
					
						
						
							
						
						ba298a32b3 
					 
					
						
						
							
							Refs  #31169  -- Prevented infinite loop in parallel tests with custom test runner when using spawn.  
						
						... 
						
						
						
						Regression in 3b3f38b3b0felisiak.mariusz@gmail.com > 
						
						
					 
					
						2022-03-17 10:20:13 +01:00 
						 
				 
			
				
					
						
							
							
								David Smith 
							
						 
					 
					
						
						
							
						
						3b3f38b3b0 
					 
					
						
						
							
							Fixed   #31169  -- Adapted the parallel test runner to use spawn.  
						
						... 
						
						
						
						Co-authored-by: Valz <ahmadahussein0@gmail.com >
Co-authored-by: Nick Pope <nick@nickpope.me.uk > 
						
						
					 
					
						2022-03-15 16:23:55 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						7119f40c98 
					 
					
						
						
							
							Refs  #33476  -- Refactored code to strictly match 88 characters line length.  
						
						
						
						
					 
					
						2022-02-07 20:37:05 +01:00 
						 
				 
			
				
					
						
							
							
								django-bot 
							
						 
					 
					
						
						
							
						
						9c19aff7c7 
					 
					
						
						
							
							Refs  #33476  -- Reformatted code with Black.  
						
						
						
						
					 
					
						2022-02-07 20:37:05 +01:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						c5cd878382 
					 
					
						
						
							
							Refs  #33476  -- Refactored problematic code before reformatting by Black.  
						
						... 
						
						
						
						In these cases Black produces unexpected results, e.g.
def make_random_password(
    self,
    length=10,
    allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):
or
cursor.execute("""
SELECT ...
""",
    [table name],
) 
						
						
					 
					
						2022-02-03 11:20:46 +01:00 
						 
				 
			
				
					
						
							
							
								Baptiste Mispelon 
							
						 
					 
					
						
						
							
						
						91acfc3514 
					 
					
						
						
							
							Fixed   #33264  -- Made test runner return non-zero error code for unexpected successes.  
						
						
						
						
					 
					
						2021-11-08 20:19:21 +01:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						b263f4b69d 
					 
					
						
						
							
							Fixed   #32552  -- Added logger argument to DiscoverRunner.  
						
						
						
						
					 
					
						2021-08-24 09:23:01 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						36714be874 
					 
					
						
						
							
							Refs  #31621  -- Fixed handling --parallel option in test management command and runtests.py.  
						
						... 
						
						
						
						Regression in ae89daf46f 
						
						
					 
					
						2021-08-19 09:18:32 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						c2a5735d86 
					 
					
						
						
							
							Refs  #31621  -- Added more tests for test --parallel option.  
						
						
						
						
					 
					
						2021-08-19 09:18:32 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						ab16507f19 
					 
					
						
						
							
							Fixed   #32988  -- Prevented creation of more test databases than TestCases.  
						
						... 
						
						
						
						DiscoverRunner.parallel is used in setup_databases() and
teardown_databases() to control the number of test databases.
Regression in cb6c19749d 
						
						
					 
					
						2021-08-05 05:55:35 +02:00 
						 
				 
			
				
					
						
							
							
								Adam Johnson 
							
						 
					 
					
						
						
							
						
						ae89daf46f 
					 
					
						
						
							
							Fixed   #31621  -- Added support for '--parallel auto' to test management command.  
						
						
						
						
					 
					
						2021-08-03 09:57:04 +02:00 
						 
				 
			
				
					
						
							
							
								Adam Johnson 
							
						 
					 
					
						
						
							
						
						7e38a8d66f 
					 
					
						
						
							
							Refs  #31621  -- Added more tests for test --parallel option.  
						
						
						
						
					 
					
						2021-08-03 09:57:04 +02:00 
						 
				 
			
				
					
						
							
							
								Jacob Walls 
							
						 
					 
					
						
						
							
						
						56f9579105 
					 
					
						
						
							
							Fixed   #32655  -- Deprecated extra_tests argument for DiscoverRunner.build_suite()/run_tests().  
						
						
						
						
					 
					
						2021-07-16 20:46:41 +02:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						5848b3a1d7 
					 
					
						
						
							
							Fixed   #32914  -- Prevented test --shuffle from skipping test methods.  
						
						... 
						
						
						
						"test --shuffle" skipped test methods when test classes were mixed.
This changes runner.py's reorder_tests() to group by TestCase class.
Regression in 90ba716bf0 
						
						
					 
					
						2021-07-12 06:36:12 +02:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						90ba716bf0 
					 
					
						
						
							
							Fixed   #24522  -- Added a --shuffle option to DiscoverRunner.  
						
						
						
						
					 
					
						2021-07-08 07:29:04 +02:00 
						 
				 
			
				
					
						
							
							
								Mads Jensen 
							
						 
					 
					
						
						
							
						
						c51bf80d56 
					 
					
						
						
							
							Used more specific unittest assertions in tests.  
						
						
						
						
					 
					
						2021-07-07 10:51:38 +02:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						8bca838f4a 
					 
					
						
						
							
							Refs  #32655  -- Improved error if iter_test_cases() is passed a string.  
						
						
						
						
					 
					
						2021-06-29 20:41:40 +02:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						de4f620183 
					 
					
						
						
							
							Fixed   #32609  -- Updated runtests.py to support directory path test labels.  
						
						... 
						
						
						
						For example, with this change, the following now works from the tests
directory:
    $ ./runtests.py view_tests/tests/ 
						
						
					 
					
						2021-06-10 20:19:30 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						8b4983cfd4 
					 
					
						
						
							
							Fixed typo in tests/test_runner/test_discover_runner.py.  
						
						
						
						
					 
					
						2021-06-10 13:25:05 +02:00 
						 
				 
			
				
					
						
							
							
								Ceesjan Luiten 
							
						 
					 
					
						
						
							
						
						cb6c19749d 
					 
					
						
						
							
							Refs  #27734  -- Prevented creation of more parallel workers than TestCases.  
						
						... 
						
						
						
						The parallel test runner uses multiple workers to distribute the
workload. These workers are assigned a worker ID using a globally
incremented variable, which determines what test database to connect
to. When the worker ID surpasses the test database IDs Django will
crash.
This reduce likelihood of crashing parallel tests because
ParallelTestSuite will no longer create more workers than TestCases.
It won't eliminate the problem completely though because there are
other circumstances in which new workers can be created which can then
be assigned an "illegal" worker ID. 
						
						
					 
					
						2021-06-10 07:32:15 +02:00 
						 
				 
			
				
					
						
							
							
								Mariusz Felisiak 
							
						 
					 
					
						
						
							
						
						62e8f369c3 
					 
					
						
						
							
							Fixed   #32808  -- Prevented DiscoverRunner.build_suite() from mutating test loader patterns.  
						
						... 
						
						
						
						Thanks Chris Jerdonek for the report and reviews. 
						
						
					 
					
						2021-06-03 08:59:37 +02:00 
						 
				 
			
				
					
						
							
							
								Chris Jerdonek 
							
						 
					 
					
						
						
							
						
						1b4d1675b2 
					 
					
						
						
							
							Refs  #32641  -- Made DiscoverRunner's "Found X tests" message work for finding one test.  
						
						... 
						
						
						
						This also removes passing level to log() as logging.INFO is the default. 
						
						
					 
					
						2021-06-02 12:53:09 +02:00 
						 
				 
			
				
					
						
							
							
								Daniyal 
							
						 
					 
					
						
						
							
						
						a0410ffe8f 
					 
					
						
						
							
							Refs  #32552  -- Added DiscoverRunner.log() to allow customization.  
						
						... 
						
						
						
						Thanks Carlton Gibson, Chris Jerdonek, and David Smith for reviews. 
						
						
					 
					
						2021-06-01 13:31:44 +02:00 
						 
				 
			
				
					
						
							
							
								girishsontakke 
							
						 
					 
					
						
						
							
						
						a815a6a315 
					 
					
						
						
							
							Fixed   #32641  -- Made DiscoverRunner print the number of found tests.  
						
						... 
						
						
						
						Thanks Chris Jerdonek for reviews. 
						
						
					 
					
						2021-04-15 11:42:46 +02:00