Skip to content

Commit a6f72d3

Browse files
Apply ruff/flake8-bugbear rule B015
B015 Pointless comparison.
1 parent ab1c598 commit a6f72d3

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

skrub/_data_ops/tests/test_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_contains():
4141
with pytest.raises(
4242
TypeError, match=".*it is not possible to eagerly perform membership tests"
4343
):
44-
2 in a
44+
2 in a # noqa: B015
4545

4646

4747
def test_setitem():

skrub/_data_ops/tests/test_estimators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_randomized_search(data_op, data, n_jobs):
190190
def test_grid_search(data_op, data, n_jobs):
191191
search = data_op.skb.make_grid_search(n_jobs=n_jobs)
192192
search.fit(data)
193-
search.results_["mean_test_score"].iloc[0] == pytest.approx(0.84, abs=0.05)
193+
assert search.results_["mean_test_score"].iloc[0] == pytest.approx(0.84, abs=0.05)
194194
assert search.decision_function(data).shape == (100,)
195195
train_score = search.score(data)
196196
assert train_score == pytest.approx(0.94)

skrub/tests/test_agg_joiner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_agg_joiner_default_cols(main_table):
408408
aux_table=main_table, operations="mode", key=["movieId", "userId"]
409409
)
410410
agg_joiner.fit(main_table)
411-
agg_joiner._cols == ["rating", "genre"]
411+
assert agg_joiner._cols == ["rating", "genre"]
412412

413413

414414
def test_agg_joiner_correct_cols(df_module, main_table):
@@ -422,7 +422,7 @@ def test_agg_joiner_correct_cols(df_module, main_table):
422422
cols=["rating"],
423423
)
424424
agg_joiner.fit(main_table)
425-
agg_joiner._cols == ["rating"]
425+
assert agg_joiner._cols == ["rating"]
426426

427427

428428
def test_agg_joiner_wrong_cols(main_table):
@@ -662,7 +662,7 @@ def test_agg_target_multiple_main_key(df_module, main_table, y_df):
662662
operations="max",
663663
)
664664
main_transformed = agg_target.fit_transform(main_table, y_df)
665-
sbd.column_names(main_transformed) == [
665+
assert sbd.column_names(main_transformed) == [
666666
"userId",
667667
"movieId",
668668
"rating",

skrub/tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_max_plot_columns(simple_df):
8686
# repr_html.
8787
with config_context(use_table_report=True):
8888
with config_context(max_plot_columns=3):
89-
"Plotting was skipped" in simple_df._repr_html_()
89+
assert "Plotting was skipped" in simple_df._repr_html_()
9090

9191

9292
def test_enable_subsampling(simple_df):

skrub/tests/test_multi_agg_joiner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ def test_default_cols(main_table, df_module):
341341
keys=[["userId", "movieId"], ["userId"]],
342342
)
343343
multi_agg_joiner.fit(main_table)
344-
multi_agg_joiner._cols == [["rating", "genre"], ["movieId", "rating", "genre"]]
344+
assert multi_agg_joiner._cols == [
345+
["rating", "genre"],
346+
["movieId", "rating", "genre"],
347+
]
345348

346349

347350
def test_correct_cols(main_table, df_module):

0 commit comments

Comments
 (0)