tests: Separate lister instantiations
Prior to this commit, all listers were instantiated at the same time even if only one was needed. This commit separates those instantiations. The only drawback to this is the db model initialization which now happens at each lister instantiation. This can be dealt with if needed at another time though.
This commit is contained in:
parent
92422dcf75
commit
5a5b7ef70b
14 changed files with 127 additions and 87 deletions
|
@ -7,6 +7,8 @@ import logging
|
|||
import re
|
||||
import unittest
|
||||
|
||||
import pytest
|
||||
|
||||
from swh.lister.core.tests.test_lister import HttpListerTesterBase
|
||||
from swh.lister.gitea.lister import GiteaLister
|
||||
|
||||
|
@ -38,8 +40,13 @@ class GiteaListerTester(HttpListerTesterBase, unittest.TestCase):
|
|||
return headers
|
||||
|
||||
|
||||
def test_lister_gitea(swh_listers, requests_mock_datadir):
|
||||
lister: GiteaLister = swh_listers["gitea"]
|
||||
@pytest.fixture
|
||||
def lister_under_test():
|
||||
return "gitea"
|
||||
|
||||
|
||||
def test_lister_gitea(swh_lister, requests_mock_datadir):
|
||||
lister: GiteaLister = swh_lister
|
||||
|
||||
lister.run()
|
||||
r = lister.scheduler.search_tasks(task_type="load-git")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue