summaryrefslogtreecommitdiff
path: root/tests/test_runner
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-012-2/+0
| | | | | | | | 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
* Refs #32655 -- Removed extra_tests argument for ↵Mariusz Felisiak2023-01-171-40/+0
| | | | | | DiscoverRunner.build_suite()/run_tests(). Per deprecation timeline.
* Refs #32446 -- Removed SERIALIZE test database setting per deprecation timeline.Mariusz Felisiak2023-01-171-25/+1
|
* Avoided assignment followed by immediate return.Nick Pope2022-10-311-2/+1
| | | | | | | | Identified using the following command: $ pcre2grep --line-number --multiline --recursive \ "(?s)(\n +)(\w+) = [^\n]+\1return \2;?$" \ django docs extras js_tests scripts tests
* Fixed #34111 -- Made test runner with --debug-sql format SQL queries.Giebisch2022-10-241-12/+12
|
* Refs #34010 -- Made --debug-mode work for parallel tests using spawn.Adam Johnson2022-09-281-1/+6
| | | | | | Bug in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc. Thanks Kevin Renskers for the report.
* Fixed #33719 -- Fixed test command crash when running in parallel.Mariusz Felisiak2022-05-191-0/+41
| | | | | Thanks Pēteris Caune for the report. Regression in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc.
* Refs #33173 -- Fixed test_runner/test_utils tests on Python 3.11+.Mariusz Felisiak2022-04-072-6/+13
| | | | Python 3.11 uses fully qualified test name in unittest output. See https://github.com/python/cpython/commit/755be9b1505af591b9f2ee424a6525b6c2b65ce9
* Refs #31169 -- Prevented infinite loop in parallel tests with custom test ↵David Smith2022-03-171-0/+45
| | | | | | | | runner when using spawn. Regression in 3b3f38b3b09b0f2373e51406ecb8c9c45d36aebc. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #31169 -- Adapted the parallel test runner to use spawn.David Smith2022-03-152-6/+14
| | | | | Co-authored-by: Valz <ahmadahussein0@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-3/+6
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-077-603/+880
|
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-2/+1
| | | | | | | | | | | | | | | | | 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], )
* Fixed #33264 -- Made test runner return non-zero error code for unexpected ↵Baptiste Mispelon2021-11-081-0/+18
| | | | successes.
* Fixed #32552 -- Added logger argument to DiscoverRunner.Chris Jerdonek2021-08-241-0/+21
|
* Refs #31621 -- Fixed handling --parallel option in test management command ↵Mariusz Felisiak2021-08-192-14/+32
| | | | | | | and runtests.py. Regression in ae89daf46f83a7b39d599d289624c3377bfa4ab1. Thanks Tim Graham for the report.
* Refs #31621 -- Added more tests for test --parallel option.Mariusz Felisiak2021-08-191-1/+64
|
* Fixed #32988 -- Prevented creation of more test databases than TestCases.Mariusz Felisiak2021-08-051-0/+20
| | | | | | DiscoverRunner.parallel is used in setup_databases() and teardown_databases() to control the number of test databases. Regression in cb6c19749d342c3dc0f97d89ff6887b220cf45b8.
* Fixed #31621 -- Added support for '--parallel auto' to test management command.Adam Johnson2021-08-031-1/+16
|
* Refs #31621 -- Added more tests for test --parallel option.Adam Johnson2021-08-031-0/+35
|
* Fixed #32655 -- Deprecated extra_tests argument for ↵Jacob Walls2021-07-162-1/+40
| | | | DiscoverRunner.build_suite()/run_tests().
* Fixed #32914 -- Prevented test --shuffle from skipping test methods.Chris Jerdonek2021-07-121-0/+26
| | | | | | | "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.
* Fixed #24522 -- Added a --shuffle option to DiscoverRunner.Chris Jerdonek2021-07-083-1/+267
|
* Used more specific unittest assertions in tests.Mads Jensen2021-07-071-2/+2
|
* Refs #32655 -- Improved error if iter_test_cases() is passed a string.Chris Jerdonek2021-06-291-1/+9
|
* Fixed #32609 -- Updated runtests.py to support directory path test labels.Chris Jerdonek2021-06-101-1/+1
| | | | | | | For example, with this change, the following now works from the tests directory: $ ./runtests.py view_tests/tests/
* Fixed typo in tests/test_runner/test_discover_runner.py.Mariusz Felisiak2021-06-101-2/+2
|
* Refs #27734 -- Prevented creation of more parallel workers than TestCases.Ceesjan Luiten2021-06-101-0/+6
| | | | | | | | | | | | | | | 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.
* Fixed #32808 -- Prevented DiscoverRunner.build_suite() from mutating test ↵Mariusz Felisiak2021-06-031-0/+32
| | | | | loader patterns. Thanks Chris Jerdonek for the report and reviews.
* Refs #32641 -- Made DiscoverRunner's "Found X tests" message work for ↵Chris Jerdonek2021-06-021-1/+1
| | | | | finding one test. This also removes passing level to log() as logging.INFO is the default.
* Refs #32552 -- Added DiscoverRunner.log() to allow customization.Daniyal2021-06-011-0/+38
| | | | Thanks Carlton Gibson, Chris Jerdonek, and David Smith for reviews.
* Fixed #32641 -- Made DiscoverRunner print the number of found tests.girishsontakke2021-04-151-23/+36
| | | | Thanks Chris Jerdonek for reviews.
* Fixed #32532 -- Made DiscoverRunner raise RuntimeError when a test label is ↵Chris Jerdonek2021-04-021-0/+10
| | | | a file path.
* Fixed #29127 -- Prevented DiscoverRunner from hiding tagged test with syntax ↵Chris Jerdonek2021-03-301-0/+13
| | | | | | errors. This mades _FailedTest objects always match tags in DiscoverRunner.
* Fixed #32591 -- Made DiscoverRunner order _FailedTest objects first.Chris Jerdonek2021-03-261-0/+10
| | | | | | 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.
* Fixed RemoteTestResultTest tests without tblib.Mariusz Felisiak2021-03-251-4/+13
| | | Follow up to e3bca22e7e572b0274a0814c7869c899d7b544e0.
* Fixed #31370 -- Added support for parallel tests with --buffer.Adam Johnson2021-03-181-8/+0
|
* Refs #31370 -- Made RemoteTestResult subclass unittest.TestResult.Adam Johnson2021-03-181-0/+30
|
* Refs #31370 -- Added test for pickling RemoteTestResult.Adam Johnson2021-03-181-0/+6
|
* Fixed #32529 -- Delayed creating a test suite in build_suite().Chris Jerdonek2021-03-111-7/+8
|
* Refs #32489 -- Doc'd and tested iter_test_cases() support for an iterable of ↵Chris Jerdonek2021-03-111-0/+14
| | | | tests.
* Fixed #32516 -- Fixed reorder_suite() with duplicates and reverse=True.Chris Jerdonek2021-03-091-23/+50
|
* Fixed #32489 -- Added iter_test_cases() to iterate over a TestSuite.Chris Jerdonek2021-03-051-0/+81
| | | | | | This also makes partition_suite_by_type(), partition_suite_by_case(), filter_tests_by_tags(), and DiscoverRunner._get_databases() to use iter_test_cases().
* Fixed #32446 -- Deprecated SERIALIZE test database setting.Simon Charette2021-02-242-10/+25
| | | | | | | | | | | 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.
* Fixed #29052 -- Made test database creation preserve alias order and prefer ↵Harm Geerts2021-02-161-1/+30
| | | | | | | | | | | | | | 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.
* Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak2021-02-102-9/+3
|
* Fixed isolation of test_runner.EmptyDefaultDatabaseTest.Mariusz Felisiak2020-12-101-5/+6
| | | | This fixes test_runner.test_debug_sql.TestDebugSQL. test_setupclass_exception when run in reverse.
* Fixed #32227 -- Prevented crash when setUpTestData() errors with --debug-sql.Adam Johnson2020-11-281-0/+27
| | | | Thanks Mariusz Felisiak for the report.
* Refs #31811 -- Added optional timing outputs to the test runner.Ahmad A. Hussein2020-08-132-2/+27
|
* Fixed #31509 -- Made DiscoverRunner enable faulthandler by default.ovkulkarni2020-07-101-1/+28
|