Skip to content

Commit 70ec159

Browse files
committed
fix return lints, add ruff per-file-ignore for test directorys
1 parent 65239d9 commit 70ec159

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

ruff.toml

+1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ ignore = [
6565
"I",
6666
]
6767
"doc_examples/*" = ["F821"]
68+
"tests/*" = ["BLE001", "F405", "PT011", "PT012", "PT015", "PT017", "SIM114"]
6869
"pysimplesql/language_pack.py" = ["E501"]
6970
"pysimplesql/theme_pack.py" = ["E501"]

tests/sqldriver_test.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,20 @@ def sqlserver_container():
9393
def driver(request):
9494
driver_class = request.param
9595

96+
# Use an in-memory database for sqlite tests
9697
if driver_class == ss.Driver.sqlite:
97-
return driver_class(
98-
db_path=":memory:"
99-
) # Use an in-memory database for sqlite tests
100-
elif driver_class == ss.Driver.flatfile:
98+
return driver_class(db_path=":memory:")
99+
if driver_class == ss.Driver.flatfile:
101100
return driver_class(file_path="test.csv")
102-
elif driver_class == ss.Driver.mysql:
101+
if driver_class == ss.Driver.mysql:
103102
return driver_class(**mysql_docker)
104-
elif driver_class == ss.Driver.postgres:
103+
if driver_class == ss.Driver.postgres:
105104
return driver_class(**postgres_docker)
106-
elif driver_class == ss.Driver.sqlserver:
105+
if driver_class == ss.Driver.sqlserver:
107106
return driver_class(**sqlserver_docker)
108-
elif driver_class == ss.Driver.msaccess:
107+
if driver_class == ss.Driver.msaccess:
109108
return driver_class(database_file="test.accdb")
110-
else:
111-
raise NotImplementedError("Driver class not supported in tests.")
109+
raise NotImplementedError("Driver class not supported in tests.")
112110

113111

114112
# --------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)