File tree 1 file changed +10
-4
lines changed
pandas/tests/tseries/frequencies
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -431,12 +431,18 @@ def test_series_invalid_type(end):
431
431
frequencies .infer_freq (s )
432
432
433
433
434
- def test_series_inconvertible_string ():
434
+ def test_series_inconvertible_string (using_infer_string ):
435
435
# see gh-6407
436
- msg = "Unknown datetime string format"
436
+ if using_infer_string :
437
+ msg = "cannot infer freq from"
437
438
438
- with pytest .raises (ValueError , match = msg ):
439
- frequencies .infer_freq (Series (["foo" , "bar" ]))
439
+ with pytest .raises (TypeError , match = msg ):
440
+ frequencies .infer_freq (Series (["foo" , "bar" ]))
441
+ else :
442
+ msg = "Unknown datetime string format"
443
+
444
+ with pytest .raises (ValueError , match = msg ):
445
+ frequencies .infer_freq (Series (["foo" , "bar" ]))
440
446
441
447
442
448
@pytest .mark .parametrize ("freq" , [None , "ms" ])
You can’t perform that action at this time.
0 commit comments