Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """Unit test fixtures.""" |
||
2 | |||
3 | import pytest |
||
4 | |||
5 | from kytos.core import Controller |
||
6 | from kytos.lib.helpers import get_controller_mock |
||
7 | |||
8 | |||
9 | @pytest.fixture(autouse=True) |
||
10 | def ev_loop(monkeypatch, event_loop) -> None: |
||
11 | """asyncio event loop autouse fixture.""" |
||
12 | monkeypatch.setattr("asyncio.get_running_loop", lambda: event_loop) |
||
13 | yield event_loop |
||
14 | |||
15 | |||
16 | @pytest.fixture |
||
17 | def controller() -> Controller: |
||
18 | """Controller fixture.""" |
||
19 | yield get_controller_mock() |
||
20 |