Skip to content

Commit 35a34f2

Browse files
committed
use pytest.mark.usefixtures in test_smtp
1 parent bd55afa commit 35a34f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/test_smtp/test_smtp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def create_virtual_file(name: str, content: str = "data") -> StringIO:
4747
return f
4848

4949

50+
@pytest.mark.usefixtures("mocker")
5051
@pytest.mark.parametrize(
5152
("html", "files", "expected_types"),
5253
[
@@ -74,7 +75,6 @@ def test_send_email_content(
7475
html: str | None,
7576
files: list[str] | None,
7677
expected_types: list[str],
77-
mocker: MockerFixture,
7878
):
7979
files_with_data = (
8080
[
@@ -140,7 +140,8 @@ def test_attachment_disposition(smtp: SMTP, mock_conn: MagicMock):
140140
assert "attachment" in file_part.get("Content-Disposition")
141141

142142

143-
def test_send_email_files_as_single_string(smtp: SMTP, mock_conn: MagicMock, mocker: MockerFixture):
143+
@pytest.mark.usefixtures("mock_conn")
144+
def test_send_email_files_as_single_string(smtp: SMTP, mocker: MockerFixture):
144145
# We mock the attachment creator because we only care about the input conversion here
145146
mock_create = mocker.patch.object(smtp, "_create_message_attachments")
146147
filename = "single_report.pdf"

0 commit comments

Comments
 (0)