Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Nov 15, 2024
1 parent 6cea495 commit b5067da
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/unit/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_spans_bind_get(self):
pool.bind(database)

with trace_call("pool.Get", SESSIONS[0]) as span:
session = pool.get()
pool.get()
wantEventNames = [
"Acquiring session",
"Waiting for a session to become available",
Expand Down Expand Up @@ -250,7 +250,7 @@ def test_spans_get_create_sessions(self):
database._sessions.extend(SESSIONS)
try:
pool.bind(database)
except Exception as e:
except Exception:
pass

wantEventNames = [
Expand Down Expand Up @@ -413,7 +413,7 @@ def test_spans_get_empty_pool(self):
database._sessions.append(session1)
pool.bind(database)

with trace_call("pool.Get", session1) as span:
with trace_call("pool.Get", session1):
session = pool.get()
self.assertIsInstance(session, _Session)
self.assertIs(session._database, database)
Expand Down Expand Up @@ -450,7 +450,7 @@ def test_spans_get_non_empty_session_exists(self):
database = _Database("name")
previous = _Session(database)
pool.bind(database)
with trace_call("pool.Get", previous) as span:
with trace_call("pool.Get", previous):
pool.put(previous)
session = pool.get()
self.assertIs(session, previous)
Expand Down Expand Up @@ -496,7 +496,7 @@ def test_spans_put_empty(self):
pool.bind(database)
session = _Session(database)

with trace_call("pool.put", session) as span:
with trace_call("pool.put", session):
pool.put(session)
self.assertFalse(pool._sessions.empty())

Expand Down Expand Up @@ -524,7 +524,7 @@ def test_spans_put_full(self):
database = _Database("name")
pool.bind(database)
older = _Session(database)
with trace_call("pool.put", older) as span:
with trace_call("pool.put", older):
pool.put(older)
self.assertFalse(pool._sessions.empty())

Expand Down Expand Up @@ -839,10 +839,10 @@ def test_spans_get_empty_pool(self):
database._sessions.append(session1)
try:
pool.bind(database)
except:
except Exception:
pass

with trace_call("pool.Get", session1) as span:
with trace_call("pool.Get", session1):
session = pool.get()
self.assertIsInstance(session, _Session)
self.assertIs(session._database, database)
Expand Down Expand Up @@ -1069,13 +1069,13 @@ def test_spans_get_empty_pool(self):
database._sessions.append(session1)
try:
pool.bind(database)
except:
except Exception:
pass

with trace_call("pool.Get", session1) as span:
with trace_call("pool.Get", session1):
try:
session = pool.get()
except:
pool.get()
except Exception:
pass

self.assertTrue(pool._sessions.empty())
Expand Down Expand Up @@ -1171,7 +1171,7 @@ def __init__(self, database, exists=True, transaction=None):
self._deleted = False
self._transaction = transaction
# Generate a faux id.
self._session_id = f"time.time()"
self._session_id = f"{time.time()}"

def __lt__(self, other):
return id(self) < id(other)
Expand Down

0 comments on commit b5067da

Please sign in to comment.