@@ -94,22 +94,26 @@ def django_db_modify_db_settings_parallel_suffix(
9494def django_db_modify_db_settings (
9595 django_db_modify_db_settings_parallel_suffix : None ,
9696) -> None :
97+ """Modify db settings just before the databases are configured."""
9798 skip_if_no_django ()
9899
99100
100101@pytest .fixture (scope = "session" )
101102def django_db_use_migrations (request : pytest .FixtureRequest ) -> bool :
103+ """Return whether to use migrations to create the test databases."""
102104 return not request .config .getvalue ("nomigrations" )
103105
104106
105107@pytest .fixture (scope = "session" )
106108def django_db_keepdb (request : pytest .FixtureRequest ) -> bool :
109+ """Return whether to re-use an existing database and to keep it after the test run."""
107110 reuse_db : bool = request .config .getvalue ("reuse_db" )
108111 return reuse_db
109112
110113
111114@pytest .fixture (scope = "session" )
112115def django_db_createdb (request : pytest .FixtureRequest ) -> bool :
116+ """Return whether the database is to be re-created before running any tests."""
113117 create_db : bool = request .config .getvalue ("create_db" )
114118 return create_db
115119
@@ -656,11 +660,13 @@ def _assert_num_queries(
656660
657661@pytest .fixture ()
658662def django_assert_num_queries (pytestconfig : pytest .Config ) -> DjangoAssertNumQueries :
663+ """Allows to check for an expected number of DB queries."""
659664 return partial (_assert_num_queries , pytestconfig )
660665
661666
662667@pytest .fixture ()
663668def django_assert_max_num_queries (pytestconfig : pytest .Config ) -> DjangoAssertNumQueries :
669+ """Allows to check for an expected maximum number of DB queries."""
664670 return partial (_assert_num_queries , pytestconfig , exact = False )
665671
666672
@@ -678,6 +684,7 @@ def __call__(
678684
679685@pytest .fixture ()
680686def django_capture_on_commit_callbacks () -> DjangoCaptureOnCommitCallbacks :
687+ """Captures transaction.on_commit() callbacks for the given database connection."""
681688 from django .test import TestCase
682689
683690 return TestCase .captureOnCommitCallbacks # type: ignore[no-any-return]
0 commit comments