diff --git a/changelog.d/12197.misc b/changelog.d/12197.misc
new file mode 100644
index 0000000000000000000000000000000000000000..7d0e9b6bbf4cf952e504c1d3c6cde772d4572505
--- /dev/null
+++ b/changelog.d/12197.misc
@@ -0,0 +1 @@
+Remove some dead code.
diff --git a/tests/storage/test_database.py b/tests/storage/test_database.py
index 6fbac0ab1466747dd619eed829d7b52174f1ca5e..85978675634bacc80ca9c1ce35cd5580170f9c2b 100644
--- a/tests/storage/test_database.py
+++ b/tests/storage/test_database.py
@@ -13,26 +13,10 @@
 # limitations under the License.
 
 from synapse.storage.database import make_tuple_comparison_clause
-from synapse.storage.engines import BaseDatabaseEngine
 
 from tests import unittest
 
 
-def _stub_db_engine(**kwargs) -> BaseDatabaseEngine:
-    # returns a DatabaseEngine, circumventing the abc mechanism
-    # any kwargs are set as attributes on the class before instantiating it
-    t = type(
-        "TestBaseDatabaseEngine",
-        (BaseDatabaseEngine,),
-        dict(BaseDatabaseEngine.__dict__),
-    )
-    # defeat the abc mechanism
-    t.__abstractmethods__ = set()
-    for k, v in kwargs.items():
-        setattr(t, k, v)
-    return t(None, None)
-
-
 class TupleComparisonClauseTestCase(unittest.TestCase):
     def test_native_tuple_comparison(self):
         clause, args = make_tuple_comparison_clause([("a", 1), ("b", 2)])