summaryrefslogtreecommitdiff
path: root/tests/test_runner
AgeCommit message (Collapse)Author
2021-06-29Refs #32655 -- Improved error if iter_test_cases() is passed a string.Chris Jerdonek
2021-06-10Fixed #32609 -- Updated runtests.py to support directory path test labels.Chris Jerdonek
For example, with this change, the following now works from the tests directory: $ ./runtests.py view_tests/tests/
2021-06-10Fixed typo in tests/test_runner/test_discover_runner.py.Mariusz Felisiak
2021-06-10Refs #27734 -- Prevented creation of more parallel workers than TestCases.Ceesjan Luiten
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-03Fixed #32808 -- Prevented DiscoverRunner.build_suite() from mutating test ↵Mariusz Felisiak
loader patterns. Thanks Chris Jerdonek for the report and reviews.
2021-06-02Refs #32641 -- Made DiscoverRunner's "Found X tests" message work for ↵Chris Jerdonek
finding one test. This also removes passing level to log() as logging.INFO is the default.
2021-06-01Refs #32552 -- Added DiscoverRunner.log() to allow customization.Daniyal
Thanks Carlton Gibson, Chris Jerdonek, and David Smith for reviews.
2021-04-15Fixed #32641 -- Made DiscoverRunner print the number of found tests.girishsontakke
Thanks Chris Jerdonek for reviews.
2021-04-02Fixed #32532 -- Made DiscoverRunner raise RuntimeError when a test label is ↵Chris Jerdonek
a file path.
2021-03-30Fixed #29127 -- Prevented DiscoverRunner from hiding tagged test with syntax ↵Chris Jerdonek
errors. This mades _FailedTest objects always match tags in DiscoverRunner.
2021-03-26Fixed #32591 -- Made DiscoverRunner order _FailedTest objects first.Chris Jerdonek
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.
2021-03-25Fixed RemoteTestResultTest tests without tblib.Mariusz Felisiak
Follow up to e3bca22e7e572b0274a0814c7869c899d7b544e0.
2021-03-18Fixed #31370 -- Added support for parallel tests with --buffer.Adam Johnson
2021-03-18Refs #31370 -- Made RemoteTestResult subclass unittest.TestResult.Adam Johnson
2021-03-18Refs #31370 -- Added test for pickling RemoteTestResult.Adam Johnson
2021-03-11Fixed #32529 -- Delayed creating a test suite in build_suite().Chris Jerdonek
2021-03-11Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of ↵Chris Jerdonek
tests.
2021-03-09Fixed #32516 -- Fixed reorder_suite() with duplicates and reverse=True.Chris Jerdonek
2021-03-05Fixed #32489 -- Added iter_test_cases() to iterate over a TestSuite.Chris Jerdonek
This also makes partition_suite_by_type(), partition_suite_by_case(), filter_tests_by_tags(), and DiscoverRunner._get_databases() to use iter_test_cases().
2021-02-24Fixed #32446 -- Deprecated SERIALIZE test database setting.Simon Charette
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.
2021-02-16Fixed #29052 -- Made test database creation preserve alias order and prefer ↵Harm Geerts
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.
2021-02-10Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak
2020-12-10Fixed isolation of test_runner.EmptyDefaultDatabaseTest.Mariusz Felisiak
This fixes test_runner.test_debug_sql.TestDebugSQL. test_setupclass_exception when run in reverse.
2020-11-28Fixed #32227 -- Prevented crash when setUpTestData() errors with --debug-sql.Adam Johnson
Thanks Mariusz Felisiak for the report.
2020-08-13Refs #31811 -- Added optional timing outputs to the test runner.Ahmad A. Hussein
2020-07-10Fixed #31509 -- Made DiscoverRunner enable faulthandler by default.ovkulkarni
2020-01-20Refs #31117 -- Made various tests properly handle unexpected databases aliases.Matthijs Kooijman
- 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.
2019-12-09Fixed #27430 -- Added -b/--buffer option to DiscoverRunner.Baptiste Mispelon
2019-12-09Refs #30676 -- Added test for invalid --pdb and --parallel usage in ↵Mariusz Felisiak
DiscoverRunner.
2019-10-23Refs #29926 -- Bumped minimum tblib version to 1.5.0 in test requirements.Mariusz Felisiak
2019-10-22Refs #29926 -- Skipped RemoteTestResultTest.test_add_failing_subtests() on ↵Mariusz Felisiak
Python 3.8+ and tblib <= 1.4.0.
2019-08-07Corrected several typos in string literals and test names.Min ho Kim
2019-04-30Fixed #30245 -- Added -k option to DiscoverRunner.François Freitag
2019-02-05Simplified temporary directory handling in AdminScriptTestCase.Jon Dufresne
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.
2019-01-10Fixed #28478 -- Make DiscoverRunner skip creating unused test databases.Simon Charette
SimpleTestCase.databases makes it possible to determine the set of databases required to run the discovered tests.
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-24Refs #26840 -- Corrected SQLite connection mocking in a setup_databases() test.Simon Charette
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.
2018-12-22Renamed Sqlite and Sqlite3 references to SQLite.Nick Pope
2018-12-15Fixed #30023 -- Prevented SQLite schema alterations while foreign key checks ↵Simon Charette
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.
2018-12-05Reverted "Fixed #25251 -- Made data migrations available in ↵Tim Graham
TransactionTestCase when using --keepdb." This reverts commits b3b1d3d45fc066367f4fcacf0b06f72fcd00a9c6 and 9fa0d3786febf36c87ef059a39115aa1ce3326e8 due to reverse build failures for which a solution isn't forthcoming.
2018-11-29Refs #25251 -- Filtered out skipped tests when processing the test suite to ↵romgar
set _next_serialized_rollback.
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-11-06Fixed #25251 -- Made data migrations available in TransactionTestCase when ↵romgar
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.
2018-10-30Fixed #29866 -- Made DiscoverRunner do tests tear down if running checks or ↵Jayden Kneller
tests raises an exception.
2018-08-23Fixed #29704 -- Fixed manage.py test --testrunner if it isn't followed by an ↵Matthijs Kooijman
equals sign.
2018-08-23Added manage.py test --testrunner tests.Matthijs Kooijman
2018-07-11Fixed #29559 -- Fixed TransactionTestCase.reset_sequences for auto-created ↵Oliver Sauder
m2m through models.
2018-07-11Refs #9804 -- Fixed test for sequence reset of M2M with inherited through model.Tim Graham
2018-07-02Removed parser.add_arguments() arguments that match the defaults.Claude Paroz
2018-02-13Fixed #29106 -- Made DiscoverRunner display selected test tags.Sanyam Khurana