Skip to content

Commit 5ae43b5

Browse files
jbrockmendelmeeseeksmachine
authored andcommitted
Backport PR pandas-dev#30952: CI: numpydev changed double to single quote
1 parent fd69ff6 commit 5ae43b5

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

pandas/tests/dtypes/test_common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ def test__get_dtype(input_param, result):
668668
(None, "Cannot deduce dtype from null object"),
669669
(1, "data type not understood"),
670670
(1.2, "data type not understood"),
671-
("random string", 'data type "random string" not understood'),
671+
# numpy dev changed from double-quotes to single quotes
672+
("random string", "data type [\"']random string[\"'] not understood"),
672673
(pd.DataFrame([1, 2]), "data type not understood"),
673674
],
674675
)

pandas/tests/frame/methods/test_to_records.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_to_records_with_categorical(self):
235235
# Check that bad types raise
236236
(
237237
dict(index=False, column_dtypes={"A": "int32", "B": "foo"}),
238-
(TypeError, 'data type "foo" not understood'),
238+
(TypeError, "data type [\"']foo[\"'] not understood"),
239239
),
240240
],
241241
)

pandas/tests/indexes/interval/test_astype.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_astype_cannot_cast(self, index, dtype):
6767
index.astype(dtype)
6868

6969
def test_astype_invalid_dtype(self, index):
70-
msg = 'data type "fake_dtype" not understood'
70+
msg = "data type [\"']fake_dtype[\"'] not understood"
7171
with pytest.raises(TypeError, match=msg):
7272
index.astype("fake_dtype")
7373

pandas/tests/indexes/interval/test_constructors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_generic_errors(self, constructor):
164164
constructor(dtype="int64", **filler)
165165

166166
# invalid dtype
167-
msg = 'data type "invalid" not understood'
167+
msg = "data type [\"']invalid[\"'] not understood"
168168
with pytest.raises(TypeError, match=msg):
169169
constructor(dtype="invalid", **filler)
170170

pandas/tests/io/parser/test_dtypes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_invalid_dtype_per_column(all_parsers):
7979
3,4.5
8080
4,5.5"""
8181

82-
with pytest.raises(TypeError, match='data type "foo" not understood'):
82+
with pytest.raises(TypeError, match="data type [\"']foo[\"'] not understood"):
8383
parser.read_csv(StringIO(data), dtype={"one": "foo", 1: "int"})
8484

8585

0 commit comments

Comments
 (0)