Skip to content

Commit f593ee8

Browse files
TrigonaMinimajreback
TrigonaMinima
authored andcommitted
TST: Remaining tseries tests reorg
closes #14854 closes #15359
1 parent ec9bd44 commit f593ee8

19 files changed

+25
-224
lines changed

doc/source/whatsnew/v0.20.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ Other API Changes
371371
- ``pandas.api.types.is_datetime64_ns_dtype`` will now report ``True`` on a tz-aware dtype, similar to ``pandas.api.types.is_datetime64_any_dtype``
372372
- ``DataFrame.asof()`` will return a null filled ``Series`` instead the scalar ``NaN`` if a match is not found (:issue:`15118`)
373373
- The :func:`pd.read_gbq` method now stores ``INTEGER`` columns as ``dtype=object`` if they contain ``NULL`` values. Otherwise they are stored as ``int64``. This prevents precision lost for integers greather than 2**53. Furthermore ``FLOAT`` columns with values above 10**4 are no more casted to ``int64`` which also caused precision lost (:issue: `14064`, :issue:`14305`).
374+
- Reorganization of timeseries development tests (:issue:`14854`)
374375

375376
.. _whatsnew_0200.deprecations:
376377

pandas/tests/indexes/datetimes/test_ops.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
import pandas.util.testing as tm
88
from pandas.core.common import PerformanceWarning
99
from pandas.tseries.index import cdate_range
10+
from pandas.tseries.frequencies import get_offset, to_offset
1011
from pandas import (DatetimeIndex, PeriodIndex, Series, Timestamp, Timedelta,
1112
date_range, TimedeltaIndex, _np_version_under1p10, Index,
1213
datetime, Float64Index, offsets, bdate_range)
13-
from pandas.tseries.offsets import BMonthEnd, CDay, BDay
14+
from pandas.tseries.offsets import (BMonthEnd, CDay, BDay, Milli, MonthBegin,
15+
Micro)
1416
from pandas.tests.test_base import Ops
1517

1618

@@ -911,6 +913,16 @@ def test_equals(self):
911913
self.assertFalse(idx.equals(list(idx3)))
912914
self.assertFalse(idx.equals(pd.Series(idx3)))
913915

916+
def test_ms_vs_MS(self):
917+
left = get_offset('ms')
918+
right = get_offset('MS')
919+
self.assertEqual(left, Milli())
920+
self.assertEqual(right, MonthBegin())
921+
922+
def test_rule_aliases(self):
923+
rule = to_offset('10us')
924+
self.assertEqual(rule, Micro(10))
925+
914926

915927
class TestDateTimeIndexToJulianDate(tm.TestCase):
916928

pandas/tests/indexes/datetimes/test_setops.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pandas.util.testing as tm
77
from pandas.tseries.index import cdate_range
88
from pandas import (DatetimeIndex, date_range, Series, bdate_range, DataFrame,
9-
Int64Index, Index)
9+
Int64Index, Index, to_datetime)
1010
from pandas.tseries.offsets import Minute, BMonthEnd, MonthEnd
1111

1212
START, END = datetime(2009, 1, 1), datetime(2010, 1, 1)
@@ -190,6 +190,14 @@ def test_datetimeindex_union_join_empty(self):
190190
result = dti.join(empty)
191191
tm.assertIsInstance(result, DatetimeIndex)
192192

193+
def test_join_nonunique(self):
194+
idx1 = to_datetime(['2012-11-06 16:00:11.477563',
195+
'2012-11-06 16:00:11.477563'])
196+
idx2 = to_datetime(['2012-11-06 15:11:09.006507',
197+
'2012-11-06 15:11:09.006507'])
198+
rs = idx1.join(idx2, how='outer')
199+
self.assertTrue(rs.is_monotonic)
200+
193201

194202
class TestBusinessDatetimeIndex(tm.TestCase):
195203

File renamed without changes.
-650 Bytes
Binary file not shown.
-1.15 KB
Binary file not shown.
-646 Bytes
Binary file not shown.
-357 Bytes
Binary file not shown.

pandas/tseries/tests/test_timeseries_legacy.py

-219
This file was deleted.

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -648,13 +648,13 @@ def pxd(name):
648648
'pandas.tests.series',
649649
'pandas.tests.formats',
650650
'pandas.tests.scalar',
651+
'pandas.tests.tseries',
651652
'pandas.tests.types',
652653
'pandas.tests.test_msgpack',
653654
'pandas.tests.plotting',
654655
'pandas.tools',
655656
'pandas.tools.tests',
656657
'pandas.tseries',
657-
'pandas.tseries.tests',
658658
'pandas.types',
659659
'pandas.io.tests',
660660
'pandas.io.tests.json',
@@ -688,8 +688,7 @@ def pxd(name):
688688
'pandas.tests': ['data/*.csv'],
689689
'pandas.tests.formats': ['data/*.csv'],
690690
'pandas.tests.indexes': ['data/*.pickle'],
691-
'pandas.tseries.tests': ['data/*.pickle',
692-
'data/*.csv']
691+
'pandas.tests.tseries': ['data/*.pickle']
693692
},
694693
ext_modules=extensions,
695694
maintainer_email=EMAIL,

0 commit comments

Comments
 (0)