File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
Tests for Timestamp parsing, aimed at pandas/_libs/tslibs/parsing.pyx
3
3
"""
4
4
from datetime import datetime
5
+ import re
5
6
6
7
from dateutil .parser import parse
7
8
import numpy as np
@@ -24,7 +25,8 @@ def test_parse_time_string():
24
25
25
26
def test_parse_time_string_invalid_type ():
26
27
# Raise on invalid input, don't just return it
27
- with pytest .raises (TypeError ):
28
+ msg = "Argument 'arg' has incorrect type (expected str, got tuple)"
29
+ with pytest .raises (TypeError , match = re .escape (msg )):
28
30
parse_time_string ((4 , 5 ))
29
31
30
32
@@ -217,7 +219,8 @@ def test_try_parse_dates():
217
219
218
220
def test_parse_time_string_check_instance_type_raise_exception ():
219
221
# issue 20684
220
- with pytest .raises (TypeError ):
222
+ msg = "Argument 'arg' has incorrect type (expected str, got tuple)"
223
+ with pytest .raises (TypeError , match = re .escape (msg )):
221
224
parse_time_string ((1 , 2 , 3 ))
222
225
223
226
result = parse_time_string ("2019" )
You can’t perform that action at this time.
0 commit comments