MCPcopy
hub / github.com/django/django / test_db_signature

Method test_db_signature

django/db/backends/sqlite3/creation.py:114–128  ·  view source on GitHub ↗

Return a tuple that uniquely identifies a test database. This takes into account the special cases of ":memory:" and "" for SQLite since the databases will be distinct despite having the same TEST NAME. See https://www.sqlite.org/inmemorydb.html

(self)

Source from the content-addressed store, hash-verified

112 os.remove(test_database_name)
113
114 def test_db_signature(self):
115 """
116 Return a tuple that uniquely identifies a test database.
117
118 This takes into account the special cases of ":memory:" and "" for
119 SQLite since the databases will be distinct despite having the same
120 TEST NAME. See https://www.sqlite.org/inmemorydb.html
121 """
122 test_database_name = self._get_test_db_name()
123 sig = [self.connection.settings_dict["NAME"]]
124 if self.is_in_memory_db(test_database_name):
125 sig.append(self.connection.alias)
126 else:
127 sig.append(test_database_name)
128 return tuple(sig)
129
130 def setup_worker_connection(self, _worker_id):
131 settings_dict = self.get_test_db_clone_settings(_worker_id)

Callers

nothing calls this directly

Calls 3

_get_test_db_nameMethod · 0.95
is_in_memory_dbMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected