| Age | Commit message (Collapse) | Author |
|
|
|
For example, with this change, the following now works from the tests
directory:
$ ./runtests.py view_tests/tests/
|
|
|
|
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.
|
|
loader patterns.
Thanks Chris Jerdonek for the report and reviews.
|
|
finding one test.
This also removes passing level to log() as logging.INFO is the default.
|
|
Thanks Carlton Gibson, Chris Jerdonek, and David Smith for reviews.
|
|
Thanks Chris Jerdonek for reviews.
|
|
a file path.
|
|
errors.
This mades _FailedTest objects always match tags in DiscoverRunner.
|
|
Failures detected when loading tests are ordered before all of the
above for quicker feedback. This includes things like test modules that
couldn't be found or that couldn't be loaded due to syntax errors.
|
|
Follow up to e3bca22e7e572b0274a0814c7869c899d7b544e0.
|
|
|
|
|
|
|
|
|
|
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.
|
|
Thanks Mariusz Felisiak for the report.
|
|
|
|
|
|
- Used selected "databases" instead of django.db.connections.
- Made routers in tests.migrations skip migrations on unexpected
databases.
- Added DiscoverRunnerGetDatabasesTests.assertSkippedDatabases() hook
which properly asserts messages about skipped databases.
|
|
|
|
DiscoverRunner.
|
|
|
|
Python 3.8+ and tblib <= 1.4.0.
|
|
|
|
|
|
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.
|
|
SimpleTestCase.databases makes it possible to determine the set of
databases required to run the discovered tests.
|
|
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.
|
|
TransactionTestCase when using --keepdb."
This reverts commits b3b1d3d45fc066367f4fcacf0b06f72fcd00a9c6 and
9fa0d3786febf36c87ef059a39115aa1ce3326e8 due to reverse build failures
for which a solution isn't forthcoming.
|
|
set _next_serialized_rollback.
|
|
|
|
using --keepdb.
Data loaded in migrations were restored at the beginning of each
TransactionTestCase and all the tables are truncated at the end of
these test cases. If there was a TransactionTestCase at the end of
the test suite, the migrated data weren't restored in the database
(especially unexpected when using --keepdb). Now data is restored
at the end of each TransactionTestCase.
|
|
tests raises an exception.
|
|
equals sign.
|
|
|
|
m2m through models.
|
|
|
|
|
|
|