Skip to content

TST: Remove broken test for deprecated functionality #38707

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions pandas/tests/plotting/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@ def test_timtetonum_accepts_unicode():


class TestRegistration:
def test_register_by_default(self):
# Run in subprocess to ensure a clean state
code = (
"'import matplotlib.units; "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you fix the quoting here, does this test pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the assertion will fail then. Converters for pd.Timestamp and others are not added to units anymore on import

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ok, then this is a truly test in need of removal (that was what i am confirming. thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though i think having this test that the converters are NOT registered would actually be fine here, e.g. reverse the test as this functionaility is removed. The reason we are doing this in a subprocess as its very easy to have the ordering of imports change whether the converters is registered or not.

so we can remove the test, or better yet, to fix it and assert that pd.Timestamp is NOT added would be great.

"import pandas as pd; "
"units = dict(matplotlib.units.registry); "
"assert pd.Timestamp in units)'"
)
call = [sys.executable, "-c", code]
assert subprocess.check_call(call) == 0

@td.skip_if_no("matplotlib", min_version="3.1.3")
def test_registering_no_warning(self):
plt = pytest.importorskip("matplotlib.pyplot")
Expand Down