Remove dead code in `tests/storage/test_database.py` (#12197)

Signed-off-by: Sean Quah <seanq@element.io>
This commit is contained in:
Sean Quah 2022-03-09 18:45:21 +00:00 committed by GitHub
parent 15382b1afa
commit a4c1fdb44a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 16 deletions

1
changelog.d/12197.misc Normal file
View File

@ -0,0 +1 @@
Remove some dead code.

View File

@ -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)])