| Age | Commit message (Collapse) | Author |
|
Thanks Natalia Bidart for the review.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
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.
|
|
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.
|
|
|
|
"forkserver" is the new default on POSIX systems, and Django doesn't
support parallel tests with "forkserver":
https://github.com/python/cpython/commit/b65f2cdfa77d8d12c213aec663ddaaa30d75a4b2
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
parallel workers.
|
|
|
|
- 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.
|
|
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
|
|
DiscoverRunner.build_suite()/run_tests().
Per deprecation timeline.
|
|
|
|
Identified using the following command:
$ pcre2grep --line-number --multiline --recursive \
"(?s)(\n +)(\w+) = [^\n]+\1return \2;?$" \
django docs extras js_tests scripts tests
|
|
Bug in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc.
Thanks Kevin Renskers for the report.
|
|
Thanks Pēteris Caune for the report.
Regression in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc.
|
|
runner when using spawn.
Regression in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
Co-authored-by: Valz <ahmadahussein0@gmail.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
|
|
|
|
and runtests.py.
Regression in ae89daf46f83a7b39d599d289624c3377bfa4ab1.
Thanks Tim Graham for the report.
|
|
|
|
DiscoverRunner.build_suite()/run_tests().
|
|
"test --shuffle" skipped test methods when test classes were mixed.
This changes runner.py's reorder_tests() to group by TestCase class.
Regression in 90ba716bf060ee7fef79dc230b0b20644839069f.
|
|
|
|
|
|
|
|
tests.
|
|
|
|
This also makes partition_suite_by_type(), partition_suite_by_case(),
filter_tests_by_tags(), and DiscoverRunner._get_databases() to use
iter_test_cases().
|
|
Whether or not the state of a test database should be serialized can be
inferred from the set of databases allowed to be access from discovered
TestCase/TransactionTestCase enabling the serialized_rollback feature
which makes this setting unnecessary.
This should make a significant test suite bootstraping time difference
on large projects that didn't explicitly disable test database
serialization.
|
|
the "default" database.
This fixes flushing test databases when two aliases point to the same
database.
Use a list() to store the test database aliases so the order remains
stable by following the order of the connections. Also, always use the
"default" database alias as the first alias to accommodate `migrate`.
Previously `migrate` could be executed on a secondary alias which
caused truncating the "default" database.
|
|
This fixes test_runner.test_debug_sql.TestDebugSQL.
test_setupclass_exception when run in reverse.
|
|
|
|
|
|
Use tempfile.TemporaryDirectory() in AdminScriptTestCase.setUp()
to create and destroy a temporary directory for each test. It removes
the need for individual tests to delete files.
For test classes that don't use the temporary directory, inherit from
SimpleTestCase.
|
|
favor of databases.
|
|
The test was expecting connections used by DiscoverRunner.setup_databases()
to be the ones defined in django.test.runner but this doesn't hold true
since this method was made a proxy of django.test.utils.setup_databases.
This broke the TransactionTestCase.serialized_rollback feature in the test
suite because calls to create_db_test() cleared the test data persisted on
connections objects.
Added an assertions to prevent this from happening again.
|
|
|
|
are enabled.
Prior to this change foreign key constraint references could be left pointing
at tables dropped during operations simulating unsupported table alterations
because of an unexpected failure to disable foreign key constraint checks.
SQLite3 does not allow disabling such checks while in a transaction so they
must be disabled beforehand.
Thanks ezaquarii for the report and Carlton and Tim for the review.
|
|
tests raises an exception.
|
|
equals sign.
|
|
|
|
m2m through models.
|
|
|
|
Fixed a failure in the context processors tests when running in
reverse on MySQL due to an extra query after refs #27683.
|
|
|
|
|
|
|
|
|
|
|