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,11 +7,14 @@ import pytest
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def lister_cran(swh_listers):
|
||||
lister = swh_listers["cran"]
|
||||
def lister_under_test():
|
||||
return "cran"
|
||||
|
||||
# Add the load-deb-package in the scheduler backend
|
||||
lister.scheduler.create_task_type(
|
||||
|
||||
@pytest.fixture
|
||||
def lister_cran(swh_lister):
|
||||
# Add the load-cran in the scheduler backend
|
||||
swh_lister.scheduler.create_task_type(
|
||||
{
|
||||
"type": "load-cran",
|
||||
"description": "Load a CRAN package",
|
||||
|
@ -20,4 +23,4 @@ def lister_cran(swh_listers):
|
|||
}
|
||||
)
|
||||
|
||||
return lister
|
||||
return swh_lister
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue