Call load_archive_plugins in ComicArchive __init__

This commit is contained in:
Timmy Welch 2023-01-12 17:00:11 -08:00
parent 50614d52fc
commit f6698f7f0a
No known key found for this signature in database
4 changed files with 4 additions and 10 deletions

View File

@ -102,6 +102,7 @@ class ComicArchive:
self.archiver: Archiver = UnknownArchiver.open(self.path)
load_archive_plugins()
for archiver in archivers:
if archiver.is_valid(self.path):
self.archiver = archiver.open(self.path)

View File

@ -161,8 +161,6 @@ class App:
True,
)
comicapi.comicarchive.load_archive_plugins()
if self.options[0].runtime_no_gui:
if error and error[1]:
print(f"A fatal error occurred please check the log for more information: {error[0]}") # noqa: T201

View File

@ -12,7 +12,7 @@ from testing.filenames import datadir
@pytest.mark.xfail(not comicapi.archivers.rar.rar_support, reason="rar support")
def test_getPageNameList(load_archive_plugins):
def test_getPageNameList():
c = comicapi.comicarchive.ComicArchive(datadir / "fake_cbr.cbr")
assert c.seems_to_be_a_comic_archive()
pageNameList = c.get_page_name_list()

View File

@ -23,17 +23,12 @@ from testing.comicdata import all_seed_imprints, seed_imprints
@pytest.fixture
def cbz(load_archive_plugins):
def cbz():
yield comicapi.comicarchive.ComicArchive(filenames.cbz_path)
@pytest.fixture
def load_archive_plugins():
comicapi.comicarchive.load_archive_plugins()
@pytest.fixture
def tmp_comic(tmp_path, load_archive_plugins):
def tmp_comic(tmp_path):
shutil.copy(filenames.cbz_path, tmp_path)
yield comicapi.comicarchive.ComicArchive(tmp_path / filenames.cbz_path.name)