Passed
Pull Request — master (#284)
by Vinicius
07:43
created

tests.conftest.ev_loop()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 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