From b81bc89a964f56bb8faf329958176824925f5ac6 Mon Sep 17 00:00:00 2001 From: anishTP Date: Thu, 16 Nov 2023 14:21:19 +0530 Subject: [PATCH] Testing if test definition fails at github actions --- tests/unit/views/preview_image_test.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/unit/views/preview_image_test.py b/tests/unit/views/preview_image_test.py index 225dcd642..f9492bf5f 100644 --- a/tests/unit/views/preview_image_test.py +++ b/tests/unit/views/preview_image_test.py @@ -1,6 +1,5 @@ -import io - import pytest +from io import BytesIO from magic import from_buffer from PIL import Image @@ -15,11 +14,9 @@ def test_preview_image_jobs(project_expo2011) -> None: @pytest.mark.usefixtures('project_expo2011', 'all_fixtures') -def test_preview_image_size(project_expo2011) -> None: +def test_preview_image_size_mimeytpe(project_expo2011) -> None: render_project_preview_image(project_id=project_expo2011.id) - with Image.open(io.BytesIO(project_expo2011.preview_image)) as preview_image: + with Image.open(BytesIO(project_expo2011.preview_image)) as preview_image: assert preview_image.size == (1280, 720) - image_mimetype = from_buffer( - io.BytesIO(project_expo2011.preview_image).read(2048), mime=True - ) + image_mimetype = from_buffer(BytesIO(project_expo2011.preview_image).read(2048), mime=True) assert image_mimetype == 'image/png'