Skip to content

TST: move generic/methods/ files to frame/methods/ #38871

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 3 commits into from
Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 0 additions & 7 deletions doc/source/development/test_writing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ be located.
``frame_or_series`` fixture, by convention it goes in the
``tests.frame`` file.

- tests.generic.methods.test_mymethod

.. note::

The generic/methods/ directory is only for methods with tests
that are fully parametrized over Series/DataFrame

7. Is your test for an Index method, not depending on Series/DataFrame?
This test likely belongs in one of:

Expand Down
9 changes: 9 additions & 0 deletions pandas/tests/frame/methods/test_to_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@


class TestDataFrameToRecords:
def test_to_records_timeseries(self):
index = date_range("1/1/2000", periods=10)
df = DataFrame(np.random.randn(10, 3), index=index, columns=["a", "b", "c"])

result = df.to_records()
assert result["index"].dtype == "M8[ns]"

result = df.to_records(index=False)

def test_to_records_dt64(self):
df = DataFrame(
[["one", "two", "three"], ["four", "five", "six"]],
Expand Down
9 changes: 0 additions & 9 deletions pandas/tests/frame/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2221,15 +2221,6 @@ def test_frame_datetime64_mixed_index_ctor_1681(self):
d = DataFrame({"A": "foo", "B": ts}, index=dr)
assert d["B"].isna().all()

def test_frame_timeseries_to_records(self):
index = date_range("1/1/2000", periods=10)
df = DataFrame(np.random.randn(10, 3), index=index, columns=["a", "b", "c"])

result = df.to_records()
result["index"].dtype == "M8[ns]"

result = df.to_records(index=False)

def test_frame_timeseries_column(self):
# GH19157
dr = date_range(start="20130101T10:00:00", periods=3, freq="T", tz="US/Eastern")
Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/generic/methods/__init__.py

This file was deleted.