From 4ea0650f42ba8a0de556ef63184102fb26aa5e68 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Thu, 27 Jun 2024 22:11:50 +0300 Subject: [PATCH] tests: Skip a test for missing OCR files on Qubes We have a container-specific test that deals with missing OCR files in the container image. This test _can_ be run under Qubes, and it may fail since it requires Podman. Make the pytest guard more strict and don't allow running this test on Qubes. Also, fix a typo in the word "omission". --- tests/test_ocr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_ocr.py b/tests/test_ocr.py index 58b1b49..29d50f8 100644 --- a/tests/test_ocr.py +++ b/tests/test_ocr.py @@ -5,6 +5,7 @@ from pathlib import Path import pytest from dangerzone.isolation_provider.container import Container +from dangerzone.isolation_provider.qubes import is_qubes_native_conversion from dangerzone.logic import DangerzoneCore @@ -12,8 +13,11 @@ from dangerzone.logic import DangerzoneCore # NOTE: We skip running this test on Windows/MacOS, because our current CI cannot run # Docker in these platforms. It's not a problem anyways, because the result should be # the same in all container-based platforms. -@pytest.mark.skipif(platform.system() != "Linux", reason="Container-specific") -def test_ocr_ommisions() -> None: +@pytest.mark.skipif( + platform.system() != "Linux" or is_qubes_native_conversion(), + reason="Container-specific", +) +def test_ocr_omissions() -> None: # Create the command that will list all the installed languages in the container # image. command = [Container.get_runtime(), "run"]