Skip to content

Commit 4d8e124

Browse files
committed
test: cleanup and lint for unused arguments in test functions
1 parent 66ab2a5 commit 4d8e124

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+232
-250
lines changed

ibis/backends/athena/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def postload(self, **kw):
101101
self.connection = self.connect(schema_name=IBIS_ATHENA_TEST_DATABASE, **kw)
102102

103103
@staticmethod
104-
def connect(*, tmpdir, worker_id, **kw) -> BaseBackend:
104+
def connect(*, tmpdir, worker_id, **kw) -> BaseBackend: # noqa: ARG004
105105
return ibis.athena.connect(**CONNECT_ARGS, **kw)
106106

107107
def _remap_column_names(self, table_name: str) -> dict[str, str]:

ibis/backends/bigquery/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _load_data(self, **_: Any) -> None:
6464
query.result()
6565

6666
@staticmethod
67-
def connect(*, tmpdir, worker_id, **kw) -> Backend:
67+
def connect(*, tmpdir, worker_id, **kw) -> Backend: # noqa: ARG004
6868
"""Connect to the test project and dataset."""
6969
credentials, default_project_id = google.auth.default(
7070
scopes=EXTERNAL_DATA_SCOPES

ibis/backends/bigquery/tests/system/test_connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_repeated_project_name(project_id, credentials):
3030
def test_project_id_different_from_default_credentials(monkeypatch):
3131
creds = mock.create_autospec(auth.Credentials)
3232

33-
def mock_credentials(*args, **kwargs):
33+
def mock_credentials(*_, **__):
3434
return creds, "default-project-id"
3535

3636
monkeypatch.setattr(pydata_google_auth, "default", mock_credentials)

ibis/backends/bigquery/tests/system/udf/test_udf_execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def my_add(a: float, b: float) -> float:
4545
)
4646

4747

48-
def test_udf_with_struct(alltypes, df, snapshot):
48+
def test_udf_with_struct(alltypes, df):
4949
@udf.scalar.python
5050
def my_struct_thing(a: float, b: float) -> dt.Struct(
5151
{"width": float, "height": float}

ibis/backends/bigquery/tests/unit/udf/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def f():
4040

4141

4242
def test_yield(snapshot):
43-
def f(a):
43+
def f(_):
4444
yield from [1, 2, 3]
4545

4646
js = compile(f)
@@ -235,7 +235,7 @@ def test_class_with_properties(snapshot):
235235

236236

237237
def test_set_to_object(snapshot):
238-
def f(a):
238+
def f(_):
239239
x = set()
240240
y = 1
241241
x.add(y)
@@ -246,7 +246,7 @@ def f(a):
246246

247247

248248
def test_setitem(snapshot):
249-
def f(a):
249+
def f(_):
250250
x = {}
251251
y = "2"
252252
x[y] = y
@@ -271,7 +271,7 @@ def f(a):
271271

272272
def test_scope_with_while(snapshot):
273273
def f():
274-
class Foo:
274+
class _:
275275
def do_stuff(self):
276276
while True:
277277
i = 1

ibis/backends/bigquery/tests/unit/udf/test_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def my_len(s: str) -> float:
6666
def test_udf_int64(argument_type, return_type):
6767
# invalid argument type, valid return type
6868
@udf.scalar.python(signature=((argument_type,), return_type))
69-
def my_func(x):
69+
def my_func(_):
7070
return 1
7171

7272
expr = my_func(None)

ibis/backends/clickhouse/tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ def postload(self, **kw: Any):
7979

8080
@staticmethod
8181
def connect(
82-
*, tmpdir, worker_id, settings: Mapping[str, Any] | None = None, **kw: Any
82+
*,
83+
tmpdir, # noqa: ARG004
84+
worker_id, # noqa: ARG004
85+
settings: Mapping[str, Any] | None = None,
86+
**kw: Any,
8387
):
8488
if settings is None:
8589
settings = {}

ibis/backends/clickhouse/tests/test_aggregations.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,48 @@ def test_reduction_invalid_where(alltypes, reduction):
4545
("func", "pandas_func"),
4646
[
4747
(
48-
lambda t, cond: t.bool_col.count(),
49-
lambda df, cond: df.bool_col.count(),
48+
lambda t, _: t.bool_col.count(),
49+
lambda df, _: df.bool_col.count(),
5050
),
5151
(
52-
lambda t, cond: t.bool_col.approx_nunique(),
53-
lambda df, cond: df.bool_col.nunique(),
52+
lambda t, _: t.bool_col.approx_nunique(),
53+
lambda df, _: df.bool_col.nunique(),
5454
),
5555
(
56-
lambda t, cond: t.double_col.sum(),
57-
lambda df, cond: df.double_col.sum(),
56+
lambda t, _: t.double_col.sum(),
57+
lambda df, _: df.double_col.sum(),
5858
),
5959
(
60-
lambda t, cond: t.double_col.mean(),
61-
lambda df, cond: df.double_col.mean(),
60+
lambda t, _: t.double_col.mean(),
61+
lambda df, _: df.double_col.mean(),
6262
),
6363
(
64-
lambda t, cond: t.int_col.approx_median(),
65-
lambda df, cond: df.int_col.median(),
64+
lambda t, _: t.int_col.approx_median(),
65+
lambda df, _: df.int_col.median(),
6666
),
6767
(
68-
lambda t, cond: t.double_col.min(),
69-
lambda df, cond: df.double_col.min(),
68+
lambda t, _: t.double_col.min(),
69+
lambda df, _: df.double_col.min(),
7070
),
7171
(
72-
lambda t, cond: t.double_col.max(),
73-
lambda df, cond: df.double_col.max(),
72+
lambda t, _: t.double_col.max(),
73+
lambda df, _: df.double_col.max(),
7474
),
7575
(
76-
lambda t, cond: t.double_col.var(),
77-
lambda df, cond: df.double_col.var(),
76+
lambda t, _: t.double_col.var(),
77+
lambda df, _: df.double_col.var(),
7878
),
7979
(
80-
lambda t, cond: t.double_col.std(),
81-
lambda df, cond: df.double_col.std(),
80+
lambda t, _: t.double_col.std(),
81+
lambda df, _: df.double_col.std(),
8282
),
8383
(
84-
lambda t, cond: t.double_col.var(how="sample"),
85-
lambda df, cond: df.double_col.var(ddof=1),
84+
lambda t, _: t.double_col.var(how="sample"),
85+
lambda df, _: df.double_col.var(ddof=1),
8686
),
8787
(
88-
lambda t, cond: t.double_col.std(how="pop"),
89-
lambda df, cond: df.double_col.std(ddof=0),
88+
lambda t, _: t.double_col.std(how="pop"),
89+
lambda df, _: df.double_col.std(ddof=0),
9090
),
9191
(
9292
lambda t, cond: t.bool_col.count(where=cond),

ibis/backends/clickhouse/tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,13 @@ def test_password_with_bracket():
380380
ibis.clickhouse.connect(host=host, user=user, port=port, password=quoted_pass)
381381

382382

383-
def test_from_url(con):
383+
def test_from_url():
384384
assert ibis.connect(
385385
f"clickhouse://{CLICKHOUSE_USER}:{CLICKHOUSE_PASS}@{CLICKHOUSE_HOST}:{CLICKHOUSE_PORT}/{IBIS_TEST_CLICKHOUSE_DB}"
386386
)
387387

388388

389-
def test_from_url_with_kwargs(con):
389+
def test_from_url_with_kwargs():
390390
# since explicit kwargs take precedence, this passes, because we're passing
391391
# `database` explicitly, even though our connection string says to use a
392392
# random database

ibis/backends/clickhouse/tests/test_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ def test_timestamp_cast(alltypes, assert_sql):
7878
assert_sql(result2, "out2.sql")
7979

8080

81-
def test_timestamp_now(con, assert_sql):
81+
def test_timestamp_now(assert_sql):
8282
expr = ibis.now()
8383
assert_sql(expr)
8484

8585

8686
@pytest.mark.parametrize("unit", ["y", "m", "d", "w", "h", "minute"])
87-
def test_timestamp_truncate(con, unit, assert_sql):
87+
def test_timestamp_truncate(unit, assert_sql):
8888
stamp = ibis.timestamp("2009-05-17 12:34:56")
8989
expr = stamp.truncate(unit)
9090
assert_sql(expr)

0 commit comments

Comments
 (0)