-
-
Notifications
You must be signed in to change notification settings - Fork 145
CI: test on 3.12 #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: test on 3.12 #839
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import io | ||
import itertools | ||
from pathlib import Path | ||
import platform | ||
import string | ||
from typing import ( | ||
TYPE_CHECKING, | ||
|
@@ -1821,24 +1822,30 @@ def test_frame_getitem_isin() -> None: | |
def test_to_excel() -> None: | ||
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]}) | ||
|
||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl") | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(Path(path), engine="openpyxl") | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", startrow=1, startcol=1, header=False) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", sheet_name="sheet", index=False) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", header=["x", "y"]) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", columns=["col1"]) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with pytest_warns_bounded( | ||
DeprecationWarning, | ||
match="datetime.datetime.utcnow", | ||
lower="3.11.99", | ||
version_str=platform.python_version(), | ||
): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that this pattern is appearing all over the place, and hopefully we can one day remove it, it might be better to just create a special item in pytest_warns_bounded(
DeprecationWarning,
match="datetime.datetime.utcnow",
lower="3.11.99",
version_str=platform.python_version(),
) Then we know there is one place that is catching the same warning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found a nicer solution :) |
||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl") | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(Path(path), engine="openpyxl") | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", startrow=1, startcol=1, header=False) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", sheet_name="sheet", index=False) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", header=["x", "y"]) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
with ensure_clean() as path: | ||
df.to_excel(path, engine="openpyxl", columns=["col1"]) | ||
check(assert_type(pd.read_excel(path), pd.DataFrame), pd.DataFrame) | ||
|
||
|
||
def test_join() -> None: | ||
|
Uh oh!
There was an error while loading. Please reload this page.