From 4b6c9fd066028b624548c44e2267faabf1045bfa Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Fri, 10 Feb 2023 00:14:58 -0800 Subject: [PATCH] Fix comicarchive_test.py --- tests/comicarchive_test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/comicarchive_test.py b/tests/comicarchive_test.py index 33428ae..cec116a 100644 --- a/tests/comicarchive_test.py +++ b/tests/comicarchive_test.py @@ -121,10 +121,17 @@ def test_invalid_zip(tmp_comic): assert not result -archivers = [ - pytest.param(x.load(), marks=pytest.mark.xfail(not (x.load().enabled), reason="archiver not enabled")) - for x in entry_points(group="comicapi.archiver") -] +archivers = [] + +for x in entry_points(group="comicapi.archiver"): + archiver = x.load() + supported = archiver.enabled + exe_found = True + if archiver.exe != "": + exe_found = bool(shutil.which(archiver.exe)) + archivers.append( + pytest.param(archiver, marks=pytest.mark.xfail(not (supported and exe_found), reason="archiver not enabled")) + ) @pytest.mark.parametrize("archiver", archivers)