Skip to content

Commit

Permalink
Backport PR #30952: CI: numpydev changed double to single quote (#30957)
Browse files Browse the repository at this point in the history
Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
  • Loading branch information
2 people authored and simonjayhawkins committed Jan 13, 2020
1 parent fd69ff6 commit c3d75f5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pandas/tests/dtypes/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ def test__get_dtype(input_param, result):
(None, "Cannot deduce dtype from null object"),
(1, "data type not understood"),
(1.2, "data type not understood"),
("random string", 'data type "random string" not understood'),
# numpy dev changed from double-quotes to single quotes
("random string", "data type [\"']random string[\"'] not understood"),
(pd.DataFrame([1, 2]), "data type not understood"),
],
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/methods/test_to_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_to_records_with_categorical(self):
# Check that bad types raise
(
dict(index=False, column_dtypes={"A": "int32", "B": "foo"}),
(TypeError, 'data type "foo" not understood'),
(TypeError, "data type [\"']foo[\"'] not understood"),
),
],
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/interval/test_astype.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_astype_cannot_cast(self, index, dtype):
index.astype(dtype)

def test_astype_invalid_dtype(self, index):
msg = 'data type "fake_dtype" not understood'
msg = "data type [\"']fake_dtype[\"'] not understood"
with pytest.raises(TypeError, match=msg):
index.astype("fake_dtype")

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/interval/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_generic_errors(self, constructor):
constructor(dtype="int64", **filler)

# invalid dtype
msg = 'data type "invalid" not understood'
msg = "data type [\"']invalid[\"'] not understood"
with pytest.raises(TypeError, match=msg):
constructor(dtype="invalid", **filler)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/parser/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_invalid_dtype_per_column(all_parsers):
3,4.5
4,5.5"""

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


Expand Down

0 comments on commit c3d75f5

Please sign in to comment.