Skip to content

Commit

Permalink
make mypy and pylint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlvarezJarreta committed Sep 5, 2024
1 parent e80f836 commit ac237b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/ensembl/utils/database/dbconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ def _enable_sqlite_savepoints(self, engine: sqlalchemy.engine.Engine) -> None:

@event.listens_for(engine, "connect")
def do_connect(
dbapi_connection: sqlalchemy.engine.interfaces.DBAPIConnection,
connection_record: sqlalchemy.pool.ConnectionPoolEntry,
) -> None: # pylint: disable=unused-argument
dbapi_connection: Any, # SQLAlchemy is not clear about the type of this argument
connection_record: sqlalchemy.pool.ConnectionPoolEntry, # pylint: disable=unused-argument
) -> None:
"""Disables emitting the BEGIN statement entirely, as well as COMMIT before any DDL."""
dbapi_connection.isolation_level = None

Expand Down Expand Up @@ -223,8 +223,9 @@ def test_session_scope(self) -> Generator[sqlalchemy.orm.Session, None, None]:
# Define a new transaction event
@event.listens_for(session, "after_transaction_end")
def end_savepoint(
session: sqlalchemy.orm.Session, transaction: sqlalchemy.orm.SessionTransaction
) -> None: # pylint: disable=unused-argument
session: sqlalchemy.orm.Session, # pylint: disable=unused-argument
transaction: sqlalchemy.orm.SessionTransaction, # pylint: disable=unused-argument
) -> None:
if not connection.in_nested_transaction():
connection.begin_nested()

Expand Down
4 changes: 2 additions & 2 deletions tests/rloader/test_rloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class MockResponse:


def mock_requests_get(
file_path: Path, *args: Any, **kwargs: Any
) -> MockResponse: # pylint: disable=unused-argument
file_path: Path, *args: Any, **kwargs: Any # pylint: disable=unused-argument
) -> MockResponse:
"""Mocks `requests.get()` function, bypassing the required internet connection."""
with file_path.open("r") as in_file:
content = in_file.read()
Expand Down

0 comments on commit ac237b4

Please sign in to comment.