Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e672f7b
Enable PT001
mroeschke Dec 28, 2023
6ce08db
Add PT002
mroeschke Dec 28, 2023
fc2e0d2
Add PT003
mroeschke Dec 28, 2023
d225564
ignore 4 and 5
mroeschke Dec 28, 2023
8fe6476
Ignore 6, 7, 8
mroeschke Dec 28, 2023
d99f392
Ignore PT009
mroeschke Dec 28, 2023
8d27e34
Enable PT010
mroeschke Dec 28, 2023
d7379bd
Enable PT011
mroeschke Dec 28, 2023
0cdc13a
Ignore 12, enable 13
mroeschke Dec 28, 2023
78692da
Enable PT014
mroeschke Dec 28, 2023
893cf5b
Enforce PT015
mroeschke Dec 28, 2023
5702122
Enable 16
mroeschke Dec 28, 2023
47ce700
Disable 17
mroeschke Dec 28, 2023
a2ebb71
Ignore 18
mroeschke Dec 28, 2023
3ea2e08
Ignore 19
mroeschke Dec 28, 2023
022135b
Add 20
mroeschke Dec 28, 2023
ecf0592
add 21
mroeschke Dec 28, 2023
dd879a6
Enable 22
mroeschke Dec 28, 2023
cfaa72a
Add 23
mroeschke Dec 28, 2023
01adb5a
Add 24
mroeschke Dec 28, 2023
477d2d2
Add 25
mroeschke Dec 28, 2023
7458b8b
add 26
mroeschke Dec 28, 2023
d520b13
Add 27
mroeschke Dec 28, 2023
31c2ce3
use PT
mroeschke Dec 28, 2023
54f6bce
Merge remote-tracking branch 'upstream/main' into sty/ruff/pytest
mroeschke Dec 29, 2023
0511ebe
fix some tests
mroeschke Dec 29, 2023
01472dc
Deduplcate test
mroeschke Dec 29, 2023
2dc60a9
Merge remote-tracking branch 'upstream/main' into sty/ruff/pytest
mroeschke Jan 2, 2024
f3be5ab
Add tests
mroeschke Jan 2, 2024
9c6d650
Merge remote-tracking branch 'upstream/main' into sty/ruff/pytest
mroeschke Jan 3, 2024
44e4729
Added nested tuple case
mroeschke Jan 4, 2024
547ece5
Merge remote-tracking branch 'upstream/main' into sty/ruff/pytest
mroeschke Jan 4, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable 22
  • Loading branch information
mroeschke committed Dec 28, 2023
commit dd879a6ed947f02bbb91b410c092a2d77d3e1fe7
2 changes: 1 addition & 1 deletion pandas/tests/extension/test_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def gen(count):
for _ in range(count):
yield SparseArray(make_data(request.param), fill_value=request.param)

yield gen
return gen


@pytest.fixture(params=[0, np.nan])
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_query_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ def df(self):
by backticks. The last two columns cannot be escaped by backticks
and should raise a ValueError.
"""
yield DataFrame(
return DataFrame(
{
"A": [1, 2, 3],
"B B": [3, 2, 1],
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/io/formats/test_to_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ def df_with_symbols(self):
"""Dataframe with special characters for testing chars escaping."""
a = "a"
b = "b"
yield DataFrame({"co$e^x$": {a: "a", b: "b"}, "co^l1": {a: "a", b: "b"}})
return DataFrame({"co$e^x$": {a: "a", b: "b"}, "co^l1": {a: "a", b: "b"}})

def test_to_latex_escape_false(self, df_with_symbols):
result = df_with_symbols.to_latex(escape=False)
Expand Down Expand Up @@ -1010,7 +1010,7 @@ class TestToLatexMultiindex:
@pytest.fixture
def multiindex_frame(self):
"""Multiindex dataframe for testing multirow LaTeX macros."""
yield DataFrame.from_dict(
return DataFrame.from_dict(
{
("c1", 0): Series({x: x for x in range(4)}),
("c1", 1): Series({x: x + 4 for x in range(4)}),
Expand All @@ -1023,7 +1023,7 @@ def multiindex_frame(self):
@pytest.fixture
def multicolumn_frame(self):
"""Multicolumn dataframe for testing multicolumn LaTeX macros."""
yield DataFrame(
return DataFrame(
{
("c1", 0): {x: x for x in range(5)},
("c1", 1): {x: x + 5 for x in range(5)},
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/pytables/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pytables_hdf5_file(tmp_path):
t.row[key] = value
t.row.append()

yield path, objname, pd.DataFrame(testsamples)
return path, objname, pd.DataFrame(testsamples)


class TestReadPyTablesHDF5:
Expand Down
24 changes: 12 additions & 12 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,13 @@ def mysql_pymysql_engine():
def mysql_pymysql_engine_iris(mysql_pymysql_engine, iris_path):
create_and_load_iris(mysql_pymysql_engine, iris_path)
create_and_load_iris_view(mysql_pymysql_engine)
yield mysql_pymysql_engine
return mysql_pymysql_engine


@pytest.fixture
def mysql_pymysql_engine_types(mysql_pymysql_engine, types_data):
create_and_load_types(mysql_pymysql_engine, types_data, "mysql")
yield mysql_pymysql_engine
return mysql_pymysql_engine


@pytest.fixture
Expand Down Expand Up @@ -667,13 +667,13 @@ def postgresql_psycopg2_engine():
def postgresql_psycopg2_engine_iris(postgresql_psycopg2_engine, iris_path):
create_and_load_iris(postgresql_psycopg2_engine, iris_path)
create_and_load_iris_view(postgresql_psycopg2_engine)
yield postgresql_psycopg2_engine
return postgresql_psycopg2_engine


@pytest.fixture
def postgresql_psycopg2_engine_types(postgresql_psycopg2_engine, types_data):
create_and_load_types(postgresql_psycopg2_engine, types_data, "postgres")
yield postgresql_psycopg2_engine
return postgresql_psycopg2_engine


@pytest.fixture
Expand Down Expand Up @@ -713,7 +713,7 @@ def postgresql_adbc_iris(postgresql_adbc_conn, iris_path):
except mgr.ProgrammingError: # note arrow-adbc issue 1022
conn.rollback()
create_and_load_iris_view(conn)
yield conn
return conn


@pytest.fixture
Expand All @@ -730,7 +730,7 @@ def postgresql_adbc_types(postgresql_adbc_conn, types_data):

create_and_load_types_postgresql(conn, new_data)

yield conn
return conn


@pytest.fixture
Expand Down Expand Up @@ -784,7 +784,7 @@ def sqlite_str_iris(sqlite_str, iris_path):
def sqlite_engine_iris(sqlite_engine, iris_path):
create_and_load_iris(sqlite_engine, iris_path)
create_and_load_iris_view(sqlite_engine)
yield sqlite_engine
return sqlite_engine


@pytest.fixture
Expand All @@ -805,7 +805,7 @@ def sqlite_str_types(sqlite_str, types_data):
@pytest.fixture
def sqlite_engine_types(sqlite_engine, types_data):
create_and_load_types(sqlite_engine, types_data, "sqlite")
yield sqlite_engine
return sqlite_engine


@pytest.fixture
Expand Down Expand Up @@ -845,7 +845,7 @@ def sqlite_adbc_iris(sqlite_adbc_conn, iris_path):
except mgr.ProgrammingError:
conn.rollback()
create_and_load_iris_view(conn)
yield conn
return conn


@pytest.fixture
Expand All @@ -867,7 +867,7 @@ def sqlite_adbc_types(sqlite_adbc_conn, types_data):
create_and_load_types_sqlite3(conn, new_data)
conn.commit()

yield conn
return conn


@pytest.fixture
Expand All @@ -881,14 +881,14 @@ def sqlite_buildin():
def sqlite_buildin_iris(sqlite_buildin, iris_path):
create_and_load_iris_sqlite3(sqlite_buildin, iris_path)
create_and_load_iris_view(sqlite_buildin)
yield sqlite_buildin
return sqlite_buildin


@pytest.fixture
def sqlite_buildin_types(sqlite_buildin, types_data):
types_data = [tuple(entry.values()) for entry in types_data]
create_and_load_types_sqlite3(sqlite_buildin, types_data)
yield sqlite_buildin
return sqlite_buildin


mysql_connectable = [
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ select = [
"PT016",
"PT020",
"PT021",
"PT022",
# misc lints
"PIE",
# flake8-pyi
Expand Down