Skip to content

Commit

Permalink
Removing unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
aadel committed Mar 25, 2024
1 parent f277aeb commit a2d4dc7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/test_sql_compilation_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ def index_data(self, settings):
f.truncate_collection()
f.index()

def test_sql_compilation_caching_1(self, caplog, settings):
def test_sql_compilation_caching_1(self, settings):
_, t = prepare_orm(settings)

qry_1 = (select(t.c.CITY_s).select_from(t)).limit(1)
qry_2 = (select(t.c.CITY_s).select_from(t)).limit(10)

k1 = qry_1._generate_cache_key()
k2 = qry_2._generate_cache_key()
k1 = qry_1._generate_cache_key() # pylint: disable=protected-access
k2 = qry_2._generate_cache_key() # pylint: disable=protected-access

assert k1 == k2

def test_sql_compilation_caching_2(self, caplog, settings):
def test_sql_compilation_caching_2(self, settings):
_, t = prepare_orm(settings)

qry_1 = (select(t.c.CITY_s).select_from(t)).limit(1).offset(1)
qry_2 = (select(t.c.CITY_s).select_from(t)).limit(1).offset(2)

k1 = qry_1._generate_cache_key()
k2 = qry_2._generate_cache_key()
k1 = qry_1._generate_cache_key() # pylint: disable=protected-access
k2 = qry_2._generate_cache_key() # pylint: disable=protected-access

assert k1 == k2

def test_sql_compilation_caching_3(self, caplog, settings):
def test_sql_compilation_caching_3(self, settings):
engine, t = prepare_orm(settings)

qry = select(t).where(t.c.CITY_s == bindparam('CITY_s')).limit(10)
Expand All @@ -45,13 +45,13 @@ def test_sql_compilation_caching_3(self, caplog, settings):
assert result_1.context.cache_hit == _symbol('CACHE_MISS')
assert result_2.context.cache_hit == _symbol('CACHE_HIT')

def test_sql_compilation_caching_4(self, caplog, settings):
def test_sql_compilation_caching_4(self, settings):
_, t = prepare_orm(settings)

qry_1 = select(t).where(t.c.CITY_s == bindparam('CITY_s')).limit(10)
qry_2 = select(t).where(t.c.COUNTRY_s == bindparam('COUNTRY_s')).limit(10)

k1 = qry_1._generate_cache_key()
k2 = qry_2._generate_cache_key()
k1 = qry_1._generate_cache_key() # pylint: disable=protected-access
k2 = qry_2._generate_cache_key() # pylint: disable=protected-access

assert k1 != k2

0 comments on commit a2d4dc7

Please sign in to comment.