20
20
from asyncio import sleep
21
21
import pytest
22
22
from textwrap import dedent
23
- from typing import TYPE_CHECKING
24
23
25
- from cylc .flow .dbstatecheck import CylcWorkflowDBChecker as Checker
26
-
27
-
28
- if TYPE_CHECKING :
29
- from cylc .flow .dbstatecheck import CylcWorkflowDBChecker
24
+ from cylc .flow .dbstatecheck import CylcWorkflowDBChecker
25
+ from cylc .flow .scheduler import Scheduler
30
26
31
27
32
28
@pytest .fixture (scope = 'module' )
33
29
async def checker (
34
30
mod_flow , mod_scheduler , mod_run , mod_complete
35
- ) -> 'CylcWorkflowDBChecker' :
31
+ ):
36
32
"""Make a real world database.
37
33
38
34
We could just write the database manually but this is a better
@@ -53,17 +49,17 @@ async def checker(
53
49
'output' : {'outputs' : {'trigger' : 'message' }}
54
50
}
55
51
})
56
- schd = mod_scheduler (wid , paused_start = False )
52
+ schd : Scheduler = mod_scheduler (wid , paused_start = False )
57
53
async with mod_run (schd ):
58
54
await mod_complete (schd )
59
- schd .pool .force_trigger_tasks (['1000/good' ], [2 ])
55
+ schd .pool .force_trigger_tasks (['1000/good' ], ['2' ])
60
56
# Allow a cycle of the main loop to pass so that flow 2 can be
61
57
# added to db
62
58
await sleep (1 )
63
- yield Checker (
64
- 'somestring' , 'utterbunkum' ,
65
- schd . workflow_db_mgr . pub_path
66
- )
59
+ with CylcWorkflowDBChecker (
60
+ 'somestring' , 'utterbunkum' , schd . workflow_db_mgr . pub_path
61
+ ) as _checker :
62
+ yield _checker
67
63
68
64
69
65
def test_basic (checker ):
0 commit comments