Skip to content

Commit 5bdbf68

Browse files
committed
catch the exception by pytest
1 parent eca88db commit 5bdbf68

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

testing/test_awswrangler/test_moto.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,10 @@ def test_read_csv_pass_pandas_arguments_and_encoding_succeed(mock_open, mock_rea
230230
s3_object = s3.Object(bucket, key)
231231
s3_object.put(Body=b"foo")
232232

233-
try:
233+
with pytest.raises(TypeError):
234234
wr.s3.read_csv(path=path, encoding="ISO-8859-1", sep=",", lineterminator="\r\n")
235-
except TypeError:
236-
pass
237-
mock_open.assert_called_with(path="s3://bucket/foo/foo.csv", mode="r", encoding="ISO-8859-1", newline="\r\n")
238-
mock_read_csv.assert_called_with(ANY, compression=None, encoding="ISO-8859-1", sep=",", lineterminator="\r\n")
235+
mock_open.assert_called_with(path="s3://bucket/foo/foo.csv", mode="r", encoding="ISO-8859-1", newline="\r\n")
236+
mock_read_csv.assert_called_with(ANY, compression=None, encoding="ISO-8859-1", sep=",", lineterminator="\r\n")
239237

240238

241239
def test_to_csv_invalid_argument_combination_raise_when_dataset_false_succeed(s3):

0 commit comments

Comments
 (0)