Skip to content

Commit 13da932

Browse files
authored
TST: move generic/methods/ files to frame/methods/ (#38871)
1 parent ce5a27e commit 13da932

File tree

10 files changed

+9
-19
lines changed

10 files changed

+9
-19
lines changed

doc/source/development/test_writing.rst

-7
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,6 @@ be located.
149149
``frame_or_series`` fixture, by convention it goes in the
150150
``tests.frame`` file.
151151

152-
- tests.generic.methods.test_mymethod
153-
154-
.. note::
155-
156-
The generic/methods/ directory is only for methods with tests
157-
that are fully parametrized over Series/DataFrame
158-
159152
7. Is your test for an Index method, not depending on Series/DataFrame?
160153
This test likely belongs in one of:
161154

pandas/tests/frame/methods/test_to_records.py

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515

1616

1717
class TestDataFrameToRecords:
18+
def test_to_records_timeseries(self):
19+
index = date_range("1/1/2000", periods=10)
20+
df = DataFrame(np.random.randn(10, 3), index=index, columns=["a", "b", "c"])
21+
22+
result = df.to_records()
23+
assert result["index"].dtype == "M8[ns]"
24+
25+
result = df.to_records(index=False)
26+
1827
def test_to_records_dt64(self):
1928
df = DataFrame(
2029
[["one", "two", "three"], ["four", "five", "six"]],

pandas/tests/frame/test_constructors.py

-9
Original file line numberDiff line numberDiff line change
@@ -2221,15 +2221,6 @@ def test_frame_datetime64_mixed_index_ctor_1681(self):
22212221
d = DataFrame({"A": "foo", "B": ts}, index=dr)
22222222
assert d["B"].isna().all()
22232223

2224-
def test_frame_timeseries_to_records(self):
2225-
index = date_range("1/1/2000", periods=10)
2226-
df = DataFrame(np.random.randn(10, 3), index=index, columns=["a", "b", "c"])
2227-
2228-
result = df.to_records()
2229-
result["index"].dtype == "M8[ns]"
2230-
2231-
result = df.to_records(index=False)
2232-
22332224
def test_frame_timeseries_column(self):
22342225
# GH19157
22352226
dr = date_range(start="20130101T10:00:00", periods=3, freq="T", tz="US/Eastern")

pandas/tests/generic/methods/__init__.py

-3
This file was deleted.

0 commit comments

Comments
 (0)