Skip to content

Commit d99b95a

Browse files
committed
follow-up to pandas-dev#17943, closes pandas-dev#5168
1 parent 8449ffd commit d99b95a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tests/scalar/test_timestamp.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,19 @@ def test_constructor_invalid(self):
176176
Timestamp(Period('1000-01-01'))
177177

178178
def test_constructor_invalid_tz(self):
179-
# GH#17690, GH#5168
179+
# GH#17690
180180
with tm.assert_raises_regex(TypeError, 'must be a datetime.tzinfo'):
181181
Timestamp('2017-10-22', tzinfo='US/Eastern')
182182

183183
with tm.assert_raises_regex(ValueError, 'at most one of'):
184184
Timestamp('2017-10-22', tzinfo=utc, tz='UTC')
185185

186+
with tm.assert_raises_regex(ValueError: "Invalid frequency:"):
187+
# GH#5168
188+
# case where user tries to pass tz as an arg, not kwarg, gets
189+
# interpreted as a `freq`
190+
Timestamp('2012-01-01', 'US/Pacific')
191+
186192
def test_constructor_tz_or_tzinfo(self):
187193
# GH#17943, GH#17690, GH#5168
188194
stamps = [Timestamp(year=2017, month=10, day=22, tz='UTC'),

0 commit comments

Comments
 (0)